test_class.file: rxjava/src/test/java/io/reactivex/internal/util/MergerBiFunctionTest.java
test_class.identifier: MergerBiFunctionTest
test_case.body: @Test
      public void firstEmpty() throws Exception {
          MergerBiFunction<Integer> merger = new MergerBiFunction<Integer>(new Comparator<Integer>() {
              @Override
              public int compare(Integer o1, Integer o2) {
                  return o1.compareTo(o2);
              }
          });
          List<Integer> list = merger.apply(Collections.<Integer>emptyList(), Arrays.asList(3, 5));
  
          assertEquals(Arrays.asList(3, 5), list);
      }
test_case.class_method_signature: MergerBiFunctionTest.firstEmpty()
test_case.full_signature: @Test public void firstEmpty()
test_case.identifier: firstEmpty
test_case.invocations: compareTo apply emptyList asList assertEquals asList
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void firstEmpty()
focal_class.declarator: comparator
focal_class.modifier: final
focal_class.original_string: final Comparator<? super T> comparator;
focal_class.type: Comparator<? super T>
focal_class.var_name: comparator
focal_class.file: rxjava/src/main/java/io/reactivex/internal/util/MergerBiFunction.java
focal_class.identifier: MergerBiFunction
focal_class.interfaces: implements BiFunction<List<T>, List<T>, List<T>>
focal_class.class_method_signature: MergerBiFunction.MergerBiFunction(Comparator<? super T> comparator)
focal_class.full_signature: public  MergerBiFunction(Comparator<? super T> comparator)
focal_class.identifier: MergerBiFunction
focal_class.modifiers: public
focal_class.parameters: (Comparator<? super T> comparator)
focal_class.signature:  MergerBiFunction(Comparator<? super T> comparator)
focal_class.class_method_signature: MergerBiFunction.apply(List<T> a, List<T> b)
focal_class.full_signature: @Override public List<T> apply(List<T> a, List<T> b)
focal_class.identifier: apply
focal_class.modifiers: @Override public
focal_class.parameters: (List<T> a, List<T> b)
focal_class.return: List<T>
focal_class.signature: List<T> apply(List<T> a, List<T> b)
focal_method.body: @Override
      public List<T> apply(List<T> a, List<T> b) throws Exception {
          int n = a.size() + b.size();
          if (n == 0) {
              return new ArrayList<T>();
          }
          List<T> both = new ArrayList<T>(n);
  
          Iterator<T> at = a.iterator();
          Iterator<T> bt = b.iterator();
  
          T s1 = at.hasNext() ? at.next() : null;
          T s2 = bt.hasNext() ? bt.next() : null;
  
          while (s1 != null && s2 != null) {
              if (comparator.compare(s1, s2) < 0) { // s1 comes before s2
                  both.add(s1);
                  s1 = at.hasNext() ? at.next() : null;
              } else {
                  both.add(s2);
                  s2 = bt.hasNext() ? bt.next() : null;
              }
          }
  
          if (s1 != null) {
              both.add(s1);
              while (at.hasNext()) {
                  both.add(at.next());
              }
          } else {
              both.add(s2);
              while (bt.hasNext()) {
                  both.add(bt.next());
              }
          }
  
          return both;
      }
focal_method.class_method_signature: MergerBiFunction.apply(List<T> a, List<T> b)
focal_method.full_signature: @Override public List<T> apply(List<T> a, List<T> b)
focal_method.identifier: apply
focal_method.invocations: size size iterator iterator hasNext next hasNext next compare add hasNext next add hasNext next add hasNext add next add hasNext add next
focal_method.modifiers: @Override public
focal_method.parameters: (List<T> a, List<T> b)
focal_method.return: List<T>
focal_method.signature: List<T> apply(List<T> a, List<T> b)