test_class.file: kiji-mapreduce/src/test/java/org/kiji/mapreduce/util/TestLists.java
test_class.identifier: TestLists
test_case.body: @Test
    public void testDistinct2() {
      // Demonstrate input order preservation.
      List<String> inputs = new ArrayList<String>();
      inputs.add("b");
      inputs.add("a");
      inputs.add("a");
      inputs.add("a");
  
      List<String> outputs = new ArrayList<String>();
      outputs.add("b");
      outputs.add("a");
  
      assertTrue(outputs.equals(Lists.distinct(inputs)));
    }
test_case.class_method_signature: TestLists.testDistinct2()
test_case.full_signature: @Test public void testDistinct2()
test_case.identifier: testDistinct2
test_case.invocations: add add add add add add assertTrue equals distinct
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testDistinct2()
focal_class.file: kiji-mapreduce/src/main/java/org/kiji/mapreduce/util/Lists.java
focal_class.identifier: Lists
focal_class.class_method_signature: Lists.Lists()
focal_class.full_signature: private  Lists()
focal_class.identifier: Lists
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  Lists()
focal_class.class_method_signature: Lists.foldLeft(Y initial, List<X> inputList, Aggregator<? super X, Y> op)
focal_class.full_signature: public static Y foldLeft(Y initial, List<X> inputList, Aggregator<? super X, Y> op)
focal_class.identifier: foldLeft
focal_class.modifiers: public static
focal_class.parameters: (Y initial, List<X> inputList, Aggregator<? super X, Y> op)
focal_class.return: Y
focal_class.signature: Y foldLeft(Y initial, List<X> inputList, Aggregator<? super X, Y> op)
focal_class.class_method_signature: Lists.foldRight(Y initial, List<X> inputList, Aggregator<? super X, Y> op)
focal_class.full_signature: public static Y foldRight(Y initial, List<X> inputList, Aggregator<? super X, Y> op)
focal_class.identifier: foldRight
focal_class.modifiers: public static
focal_class.parameters: (Y initial, List<X> inputList, Aggregator<? super X, Y> op)
focal_class.return: Y
focal_class.signature: Y foldRight(Y initial, List<X> inputList, Aggregator<? super X, Y> op)
focal_class.class_method_signature: Lists.map(List<X> inputs, Func<? super X, ? extends Y> mapper)
focal_class.full_signature: public static List<Y> map(List<X> inputs, Func<? super X, ? extends Y> mapper)
focal_class.identifier: map
focal_class.modifiers: public static
focal_class.parameters: (List<X> inputs, Func<? super X, ? extends Y> mapper)
focal_class.return: List<Y>
focal_class.signature: List<Y> map(List<X> inputs, Func<? super X, ? extends Y> mapper)
focal_class.class_method_signature: Lists.toArray(List<X> inputs, Class<X> klazz)
focal_class.full_signature: @SuppressWarnings("unchecked") public static X[] toArray(List<X> inputs, Class<X> klazz)
focal_class.identifier: toArray
focal_class.modifiers: @SuppressWarnings("unchecked") public static
focal_class.parameters: (List<X> inputs, Class<X> klazz)
focal_class.return: X[]
focal_class.signature: X[] toArray(List<X> inputs, Class<X> klazz)
focal_class.class_method_signature: Lists.distinct(List<X> inputs)
focal_class.full_signature: public static List<X> distinct(List<X> inputs)
focal_class.identifier: distinct
focal_class.modifiers: public static
focal_class.parameters: (List<X> inputs)
focal_class.return: List<X>
focal_class.signature: List<X> distinct(List<X> inputs)
focal_method.body: public static <X> List<X> distinct(List<X> inputs) {
      if (null == inputs) {
        return null;
      }
  
      return foldLeft(new ArrayList<X>(), inputs, new Aggregator<X, List<X>>() {
        private Set<X> mSeen = new HashSet<X>();
  
        @Override
        public List<X> eval(X input, List<X> out) {
          if (!mSeen.contains(input)) {
            out.add(input);
            mSeen.add(input);
          }
          return out;
        }
      });
    }
focal_method.class_method_signature: Lists.distinct(List<X> inputs)
focal_method.full_signature: public static List<X> distinct(List<X> inputs)
focal_method.identifier: distinct
focal_method.invocations: foldLeft contains add add
focal_method.modifiers: public static
focal_method.parameters: (List<X> inputs)
focal_method.return: List<X>
focal_method.signature: List<X> distinct(List<X> inputs)