diff --git a/eclipse-collections-api/src/main/java/org/eclipse/collections/api/RichIterable.java b/eclipse-collections-api/src/main/java/org/eclipse/collections/api/RichIterable.java index 3f8571d7d5..37a31006d0 100644 --- a/eclipse-collections-api/src/main/java/org/eclipse/collections/api/RichIterable.java +++ b/eclipse-collections-api/src/main/java/org/eclipse/collections/api/RichIterable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Goldman Sachs and others. + * Copyright (c) 2023 Goldman Sachs and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * and Eclipse Distribution License v. 1.0 which accompany this distribution. @@ -89,10 +89,11 @@ import org.eclipse.collections.api.tuple.Pair; /** - * RichIterable is an interface which extends the InternalIterable interface with several internal iterator methods, from - * the Smalltalk Collection protocol. These include select, reject, detect, collect, injectInto, anySatisfy, - * allSatisfy. The API also includes converter methods to convert a RichIterable to a List (toList), to a sorted - * List (toSortedList), to a Set (toSet), and to a Map (toMap). + * RichIterable is a read-only interface which extends the InternalIterable interface and adds many internal iterator methods. + * The basic methods were inspired by the Smalltalk Collection protocol. These methods include select, reject, detect, + * collect, injectInto, anySatisfy, allSatisfy. The API also includes converter methods to convert a RichIterable to + * other mutable and immutable collection types. The converter methods all have a prefix of "to" (e.g. toList, toSet, + * toBag, toMap, etc). * * @since 1.0 */ @@ -322,18 +323,6 @@ else if (inside.size() > 32 && !(inside instanceof SetIterable)) * RichIterable<Person> tapped = * people.tap(person -> LOGGER.info(person.getName())); * - *

- * Example using an anonymous inner class: - *

-     * RichIterable<Person> tapped =
-     *     people.tap(new Procedure<Person>()
-     *     {
-     *         public void value(Person person)
-     *         {
-     *             LOGGER.info(person.getName());
-     *         }
-     *     });
-     * 
* * @see #each(Procedure) * @see #forEach(Procedure) @@ -348,17 +337,6 @@ else if (inside.size() > 32 && !(inside instanceof SetIterable)) *
      * people.each(person -> LOGGER.info(person.getName()));
      * 
- *

- * Example using an anonymous inner class: - *

-     * people.each(new Procedure<Person>()
-     * {
-     *     public void value(Person person)
-     *     {
-     *         LOGGER.info(person.getName());
-     *     }
-     * });
-     * 
* This method is a variant of {@link InternalIterable#forEach(Procedure)} * that has a signature conflict with {@link Iterable#forEach(java.util.function.Consumer)}. * @@ -378,18 +356,6 @@ else if (inside.size() > 32 && !(inside instanceof SetIterable)) * RichIterable<Person> selected = * people.select(person -> person.getAddress().getCity().equals("London")); * - *

- * Example using an anonymous inner class: - *

-     * RichIterable<Person> selected =
-     *     people.select(new Predicate<Person>()
-     *     {
-     *         public boolean accept(Person person)
-     *         {
-     *             return person.getAddress().getCity().equals("London");
-     *         }
-     *     });
-     * 
* * @since 1.0 */ @@ -404,18 +370,6 @@ else if (inside.size() > 32 && !(inside instanceof SetIterable)) * people.select(person -> person.person.getLastName().equals("Smith"), Lists.mutable.empty()); * *

- * Example using an anonymous inner class: - *

-     * MutableList<Person> selected =
-     *     people.select(new Predicate<Person>()
-     *     {
-     *         public boolean accept(Person person)
-     *         {
-     *             return person.person.getLastName().equals("Smith");
-     *         }
-     *     }, Lists.mutable.empty());
-     * 
- *

* * @param predicate a {@link Predicate} to use as the select criteria * @param target the Collection to append to for all elements in this {@code RichIterable} that meet select criteria {@code predicate} @@ -435,18 +389,6 @@ else if (inside.size() > 32 && !(inside instanceof SetIterable)) * RichIterable<Person> selected = * people.selectWith((Person person, Integer age) -> person.getAge()>= age, Integer.valueOf(18)); * - *

- * Example using an anonymous inner class: - *

-     * RichIterable<Person> selected =
-     *     people.selectWith(new Predicate2<Person, Integer>()
-     *     {
-     *         public boolean accept(Person person, Integer age)
-     *         {
-     *             return person.getAge()>= age;
-     *         }
-     *     }, Integer.valueOf(18));
-     * 
* * @param predicate a {@link Predicate2} to use as the select criteria * @param parameter a parameter to pass in for evaluation of the second argument {@code P} in {@code predicate} @@ -465,18 +407,6 @@ else if (inside.size() > 32 && !(inside instanceof SetIterable)) * MutableList<Person> selected = * people.selectWith((Person person, Integer age) -> person.getAge()>= age, Integer.valueOf(18), Lists.mutable.empty()); * - *

- * Example using an anonymous inner class: - *

-     * MutableList<Person> selected =
-     *     people.selectWith(new Predicate2<Person, Integer>()
-     *     {
-     *         public boolean accept(Person person, Integer age)
-     *         {
-     *             return person.getAge()>= age;
-     *         }
-     *     }, Integer.valueOf(18), Lists.mutable.empty());
-     * 
* * @param predicate a {@link Predicate2} to use as the select criteria * @param parameter a parameter to pass in for evaluation of the second argument {@code P} in {@code predicate} @@ -500,18 +430,6 @@ > R selectWith( * RichIterable<Person> rejected = * people.reject(person -> person.person.getLastName().equals("Smith")); * - *

- * Example using an anonymous inner class: - *

-     * RichIterable<Person> rejected =
-     *     people.reject(new Predicate<Person>()
-     *     {
-     *         public boolean accept(Person person)
-     *         {
-     *             return person.person.getLastName().equals("Smith");
-     *         }
-     *     });
-     * 
* * @param predicate a {@link Predicate} to use as the reject criteria * @return a RichIterable that contains elements that cause {@link Predicate#accept(Object)} method to evaluate to false @@ -529,18 +447,6 @@ > R selectWith( * RichIterable<Person> rejected = * people.rejectWith((Person person, Integer age) -> person.getAge() < age, Integer.valueOf(18)); * - *

- * Example using an anonymous inner class: - *

-     * MutableList<Person> rejected =
-     *     people.rejectWith(new Predicate2<Person, Integer>()
-     *     {
-     *         public boolean accept(Person person, Integer age)
-     *         {
-     *             return person.getAge() < age;
-     *         }
-     *     }, Integer.valueOf(18));
-     * 
* * @param predicate a {@link Predicate2} to use as the select criteria * @param parameter a parameter to pass in for evaluation of the second argument {@code P} in {@code predicate} @@ -557,18 +463,6 @@ > R selectWith( * MutableList<Person> rejected = * people.reject(person -> person.person.getLastName().equals("Smith"), Lists.mutable.empty()); * - *

- * Example using an anonymous inner class: - *

-     * MutableList<Person> rejected =
-     *     people.reject(new Predicate<Person>()
-     *     {
-     *         public boolean accept(Person person)
-     *         {
-     *             return person.person.getLastName().equals("Smith");
-     *         }
-     *     }, Lists.mutable.empty());
-     * 
* * @param predicate a {@link Predicate} to use as the reject criteria * @param target the Collection to append to for all elements in this {@code RichIterable} that cause {@code Predicate#accept(Object)} method to evaluate to false @@ -587,18 +481,6 @@ > R selectWith( * MutableList<Person> rejected = * people.rejectWith((Person person, Integer age) -> person.getAge() < age, Integer.valueOf(18), Lists.mutable.empty()); * - *

- * Example using an anonymous inner class: - *

-     * MutableList<Person> rejected =
-     *     people.rejectWith(new Predicate2<Person, Integer>()
-     *     {
-     *         public boolean accept(Person person, Integer age)
-     *         {
-     *             return person.getAge() < age;
-     *         }
-     *     }, Integer.valueOf(18), Lists.mutable.empty());
-     * 
* * @param predicate a {@link Predicate2} to use as the reject criteria * @param parameter a parameter to pass in for evaluation of the second argument {@code P} in {@code predicate} @@ -621,18 +503,6 @@ > R rejectWith( * PartitionIterable<Person> newYorkersAndNonNewYorkers = * people.partition(person -> person.getAddress().getState().getName().equals("New York")); * - *

- * Example using an anonymous inner class: - *

-     * PartitionIterable<Person> newYorkersAndNonNewYorkers =
-     *     people.partition(new Predicate<Person>()
-     *     {
-     *         public boolean accept(Person person)
-     *         {
-     *             return person.getAddress().getState().getName().equals("New York");
-     *         }
-     *     });
-     * 
* * @since 1.0. */ @@ -646,18 +516,6 @@ > R rejectWith( * PartitionIterable<Person> newYorkersAndNonNewYorkers = * people.partitionWith((Person person, String state) -> person.getAddress().getState().getName().equals(state), "New York"); * - *

- * Example using an anonymous inner class: - *

-     * PartitionIterable<Person> newYorkersAndNonNewYorkers =
-     *     people.partitionWith(new Predicate2<Person, String>()
-     *     {
-     *         public boolean accept(Person person, String state)
-     *         {
-     *             return person.getAddress().getState().getName().equals(state);
-     *         }
-     *     }, "New York");
-     * 
* * @since 5.0. */ @@ -684,18 +542,6 @@ > R rejectWith( * RichIterable<String> names = * people.collect(person -> person.getFirstName() + " " + person.getLastName()); * - *

- * Example using an anonymous inner class: - *

-     * RichIterable<String> names =
-     *     people.collect(new Function<Person, String>()
-     *     {
-     *         public String valueOf(Person person)
-     *         {
-     *             return person.getFirstName() + " " + person.getLastName();
-     *         }
-     *     });
-     * 
* * @since 1.0 */ @@ -710,18 +556,6 @@ > R rejectWith( * MutableList<String> names = * people.collect(person -> person.getFirstName() + " " + person.getLastName(), Lists.mutable.empty()); * - *

- * Example using an anonymous inner class: - *

-     * MutableList<String> names =
-     *     people.collect(new Function<Person, String>()
-     *     {
-     *         public String valueOf(Person person)
-     *         {
-     *             return person.getFirstName() + " " + person.getLastName();
-     *         }
-     *     }, Lists.mutable.empty());
-     * 
* * @param function a {@link Function} to use as the collect transformation function * @param target the Collection to append to for all elements in this {@code RichIterable} that meet select criteria {@code function} @@ -740,18 +574,6 @@ > R rejectWith( * BooleanIterable licenses = * people.collectBoolean(person -> person.hasDrivingLicense()); * - *

- * Example using an anonymous inner class: - *

-     * BooleanIterable licenses =
-     *     people.collectBoolean(new BooleanFunction<Person>()
-     *     {
-     *         public boolean booleanValueOf(Person person)
-     *         {
-     *             return person.hasDrivingLicense();
-     *         }
-     *     });
-     * 
* * @since 4.0 */ @@ -766,18 +588,6 @@ > R rejectWith( * BooleanArrayList licenses = * people.collectBoolean(person -> person.hasDrivingLicense(), new BooleanArrayList()); * - *

- * Example using an anonymous inner class: - *

-     * BooleanArrayList licenses =
-     *     people.collectBoolean(new BooleanFunction<Person>()
-     *     {
-     *         public boolean booleanValueOf(Person person)
-     *         {
-     *             return person.hasDrivingLicense();
-     *         }
-     *     }, new BooleanArrayList());
-     * 
* * @param booleanFunction a {@link BooleanFunction} to use as the collect transformation function * @param target the MutableBooleanCollection to append to for all elements in this {@code RichIterable} @@ -799,18 +609,6 @@ default R collectBoolean(BooleanFunction - *

- * Example using an anonymous inner class: - *

-     * ByteIterable bytes =
-     *     people.collectByte(new ByteFunction<Person>()
-     *     {
-     *         public byte byteValueOf(Person person)
-     *         {
-     *             return person.getCode();
-     *         }
-     *     });
-     * 
* * @since 4.0 */ @@ -825,18 +623,6 @@ default R collectBoolean(BooleanFunction - *

- * Example using an anonymous inner class: - *

-     * ByteArrayList bytes =
-     *     people.collectByte(new ByteFunction<Person>()
-     *     {
-     *         public byte byteValueOf(Person person)
-     *         {
-     *             return person.getCode();
-     *         }
-     *     }, new ByteArrayList());
-     * 
* * @param byteFunction a {@link ByteFunction} to use as the collect transformation function * @param target the MutableByteCollection to append to for all elements in this {@code RichIterable} @@ -858,18 +644,6 @@ default R collectByte(ByteFunction * CharIterable chars = * people.collectChar(person -> person.getMiddleInitial()); * - *

- * Example using an anonymous inner class: - *

-     * CharIterable chars =
-     *     people.collectChar(new CharFunction<Person>()
-     *     {
-     *         public char charValueOf(Person person)
-     *         {
-     *             return person.getMiddleInitial();
-     *         }
-     *     });
-     * 
* * @since 4.0 */ @@ -884,18 +658,6 @@ default R collectByte(ByteFunction * CharArrayList chars = * people.collectChar(person -> person.getMiddleInitial(), new CharArrayList()); * - *

- * Example using an anonymous inner class: - *

-     * CharArrayList chars =
-     *     people.collectChar(new CharFunction<Person>()
-     *     {
-     *         public char charValueOf(Person person)
-     *         {
-     *             return person.getMiddleInitial();
-     *         }
-     *     }, new CharArrayList());
-     * 
* * @param charFunction a {@link CharFunction} to use as the collect transformation function * @param target the MutableCharCollection to append to for all elements in this {@code RichIterable} @@ -917,18 +679,6 @@ default R collectChar(CharFunction * DoubleIterable doubles = * people.collectDouble(person -> person.getMilesFromNorthPole()); * - *

- * Example using an anonymous inner class: - *

-     * DoubleIterable doubles =
-     *     people.collectDouble(new DoubleFunction<Person>()
-     *     {
-     *         public double doubleValueOf(Person person)
-     *         {
-     *             return person.getMilesFromNorthPole();
-     *         }
-     *     });
-     * 
* * @since 4.0 */ @@ -943,18 +693,6 @@ default R collectChar(CharFunction * DoubleArrayList doubles = * people.collectDouble(person -> person.getMilesFromNorthPole(), new DoubleArrayList()); * - *

- * Example using an anonymous inner class: - *

-     * DoubleArrayList doubles =
-     *     people.collectDouble(new DoubleFunction<Person>()
-     *     {
-     *         public double doubleValueOf(Person person)
-     *         {
-     *             return person.getMilesFromNorthPole();
-     *         }
-     *     }, new DoubleArrayList());
-     * 
* * @param doubleFunction a {@link DoubleFunction} to use as the collect transformation function * @param target the MutableDoubleCollection to append to for all elements in this {@code RichIterable} @@ -976,18 +714,6 @@ default R collectDouble(DoubleFunction - *

- * Example using an anonymous inner class: - *

-     * FloatIterable floats =
-     *     people.collectFloat(new FloatFunction<Person>()
-     *     {
-     *         public float floatValueOf(Person person)
-     *         {
-     *             return person.getHeightInInches();
-     *         }
-     *     });
-     * 
* * @since 4.0 */ @@ -1002,18 +728,6 @@ default R collectDouble(DoubleFunction - *

- * Example using an anonymous inner class: - *

-     * FloatArrayList floats =
-     *     people.collectFloat(new FloatFunction<Person>()
-     *     {
-     *         public float floatValueOf(Person person)
-     *         {
-     *             return person.getHeightInInches();
-     *         }
-     *     }, new FloatArrayList());
-     * 
* * @param floatFunction a {@link FloatFunction} to use as the collect transformation function * @param target the MutableFloatCollection to append to for all elements in this {@code RichIterable} @@ -1035,18 +749,6 @@ default R collectFloat(FloatFunction - *

- * Example using an anonymous inner class: - *

-     * IntIterable ints =
-     *     people.collectInt(new IntFunction<Person>()
-     *     {
-     *         public int intValueOf(Person person)
-     *         {
-     *             return person.getAge();
-     *         }
-     *     });
-     * 
* * @since 4.0 */ @@ -1061,18 +763,6 @@ default R collectFloat(FloatFunction - *

- * Example using an anonymous inner class: - *

-     * IntArrayList ints =
-     *     people.collectInt(new IntFunction<Person>()
-     *     {
-     *         public int intValueOf(Person person)
-     *         {
-     *             return person.getAge();
-     *         }
-     *     }, new IntArrayList());
-     * 
* * @param intFunction a {@link IntFunction} to use as the collect transformation function * @param target the MutableIntCollection to append to for all elements in this {@code RichIterable} @@ -1094,18 +784,6 @@ default R collectInt(IntFunction int * LongIterable longs = * people.collectLong(person -> person.getGuid()); * - *

- * Example using an anonymous inner class: - *

-     * LongIterable longs =
-     *     people.collectLong(new LongFunction<Person>()
-     *     {
-     *         public long longValueOf(Person person)
-     *         {
-     *             return person.getGuid();
-     *         }
-     *     });
-     * 
* * @since 4.0 */ @@ -1120,18 +798,6 @@ default R collectInt(IntFunction int * LongArrayList longs = * people.collectLong(person -> person.getGuid(), new LongArrayList()); * - *

- * Example using an anonymous inner class: - *

-     * LongArrayList longs =
-     *     people.collectLong(new LongFunction<Person>()
-     *     {
-     *         public long longValueOf(Person person)
-     *         {
-     *             return person.getGuid();
-     *         }
-     *     }, new LongArrayList());
-     * 
* * @param longFunction a {@link LongFunction} to use as the collect transformation function * @param target the MutableLongCollection to append to for all elements in this {@code RichIterable} @@ -1153,18 +819,6 @@ default R collectLong(LongFunction * ShortIterable shorts = * people.collectShort(person -> person.getNumberOfJunkMailItemsReceivedPerMonth()); * - *

- * Example using an anonymous inner class: - *

-     * ShortIterable shorts =
-     *     people.collectShort(new ShortFunction<Person>()
-     *     {
-     *         public short shortValueOf(Person person)
-     *         {
-     *             return person.getNumberOfJunkMailItemsReceivedPerMonth();
-     *         }
-     *     });
-     * 
* * @since 4.0 */ @@ -1179,18 +833,6 @@ default R collectLong(LongFunction * ShortArrayList shorts = * people.collectShort(person -> person.getNumberOfJunkMailItemsReceivedPerMonth, new ShortArrayList()); * - *

- * Example using an anonymous inner class: - *

-     * ShortArrayList shorts =
-     *     people.collectShort(new ShortFunction<Person>()
-     *     {
-     *         public short shortValueOf(Person person)
-     *         {
-     *             return person.getNumberOfJunkMailItemsReceivedPerMonth;
-     *         }
-     *     }, new ShortArrayList());
-     * 
* * @param shortFunction a {@link ShortFunction} to use as the collect transformation function * @param target the MutableShortCollection to append to for all elements in this {@code RichIterable} @@ -1211,20 +853,6 @@ default R collectShort(ShortFunction - *

- * Example using an anonymous inner class: - *

-     * Function2<Integer, Integer, Integer> addParameterFunction =
-     *     new Function2<Integer, Integer, Integer>()
-     *     {
-     *         public Integer value(Integer each, Integer parameter)
-     *         {
-     *             return each + parameter;
-     *         }
-     *     };
-     * RichIterable<Integer> integers =
-     *     Lists.mutable.with(1, 2, 3).collectWith(addParameterFunction, Integer.valueOf(1));
-     * 
* * @param function A {@link Function2} to use as the collect transformation function * @param parameter A parameter to pass in for evaluation of the second argument {@code P} in {@code function} @@ -1242,20 +870,6 @@ default R collectShort(ShortFunction - *

- * Example using an anonymous inner class: - *

-     * Function2<Integer, Integer, Integer> addParameterFunction =
-     *     new Function2<Integer, Integer, Integer>()
-     *     {
-     *         public Integer value(final Integer each, final Integer parameter)
-     *         {
-     *             return each + parameter;
-     *         }
-     *     };
-     * MutableSet<Integer> integers =
-     *     Lists.mutable.with(1, 2, 3).collectWith(addParameterFunction, Integer.valueOf(1), Sets.mutable.empty());
-     * 
* * @param function a {@link Function2} to use as the collect transformation function * @param parameter a parameter to pass in for evaluation of the second argument {@code P} in {@code function} @@ -1474,18 +1088,6 @@ default > R flatCollectWith(Function2 - *

- * Example using an anonymous inner class: - *

-     * Person person =
-     *     people.detect(new Predicate<Person>()
-     *     {
-     *         public boolean accept(Person person)
-     *         {
-     *             return person.getFirstName().equals("John") && person.getLastName().equals("Smith");
-     *         }
-     *     });
-     * 
* * @since 1.0 */ @@ -1500,18 +1102,6 @@ default > R flatCollectWith(Function2 - *

- * Example using an anonymous inner class: - *

-     * Person person =
-     *     people.detectWith(new Predicate2<Person, String>()
-     *     {
-     *         public boolean accept(Person person, String fullName)
-     *         {
-     *             return person.getFullName().equals(fullName);
-     *         }
-     *     }, "John Smith");
-     * 
* * @since 5.0 */ @@ -1578,18 +1168,6 @@

T detectWithIfNone( * int count = * people.count(person -> person.getAddress().getState().getName().equals("New York")); * - *

- * Example using an anonymous inner class: - *

-     * int count =
-     *     people.count(new Predicate<Person>()
-     *     {
-     *         public boolean accept(Person person)
-     *         {
-     *             return person.getAddress().getState().getName().equals("New York");
-     *         }
-     *     });
-     * 
* * @since 1.0 */ @@ -2524,18 +2102,6 @@ default void appendString(Appendable appendable, String separator) * Multimap<String, Person> peopleByLastName = * people.groupBy(Person::getLastName); * - *

- * Example using an anonymous inner class: - *

-     * Multimap<String, Person> peopleByLastName =
-     *     people.groupBy(new Function<Person, String>()
-     *     {
-     *         public String valueOf(Person person)
-     *         {
-     *             return person.getLastName();
-     *         }
-     *     });
-     * 
* * @since 1.0 */ @@ -2616,18 +2182,6 @@ default > R countByEach(Function - *

- * Example using an anonymous inner class: - *

-     * FastListMultimap<String, Person> peopleByLastName =
-     *     people.groupBy(new Function<Person, String>()
-     *     {
-     *         public String valueOf(Person person)
-     *         {
-     *             return person.getLastName();
-     *         }
-     *     }, new FastListMultimap<String, Person>());
-     * 
* * @since 1.0 */ diff --git a/eclipse-collections/src/main/java/org/eclipse/collections/impl/utility/Iterate.java b/eclipse-collections/src/main/java/org/eclipse/collections/impl/utility/Iterate.java index 4b42dd4393..86ec1dc699 100644 --- a/eclipse-collections/src/main/java/org/eclipse/collections/impl/utility/Iterate.java +++ b/eclipse-collections/src/main/java/org/eclipse/collections/impl/utility/Iterate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Goldman Sachs and others. + * Copyright (c) 2023 Goldman Sachs and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * and Eclipse Distribution License v. 1.0 which accompany this distribution. @@ -113,17 +113,6 @@ private Iterate() *
      * Iterate.forEach(people, person -> LOGGER.info(person.getName());
      * 
- *

- * Example using an anonymous inner class: - *

-     * Iterate.forEach(people, new Procedure<Person>()
-     * {
-     *     public void value(Person person)
-     *     {
-     *         LOGGER.info(person.getName());
-     *     }
-     * });
-     * 
*/ public static void forEach(Iterable iterable, Procedure procedure) { @@ -168,18 +157,6 @@ else if (iterable != null) * }, fred); * * - *
e.g.
-     * Iterate.forEachWith(people, new Procedure2<Person, Person>()
-     * {
-     *     public void value(Person person, Person other)
-     *     {
-     *         if (person.isRelatedTo(other))
-     *         {
-     *              LOGGER.info(person.getName());
-     *         }
-     *     }
-     * }, fred);
-     * 
*/ public static void forEachWith( Iterable iterable, @@ -216,17 +193,6 @@ else if (iterable != null) *
      * Iterate.forEachWithIndex(people, (Person person, int index) -> LOGGER.info("Index: " + index + " person: " + person.getName()));
      * 
- *

- * Example using anonymous inner class: - *

-     * Iterate.forEachWithIndex(people, new ObjectIntProcedure<Person>()
-     * {
-     *     public void value(Person person, int index)
-     *     {
-     *         LOGGER.info("Index: " + index + " person: " + person.getName());
-     *     }
-     * });
-     * 
*/ public static void forEachWithIndex(Iterable iterable, ObjectIntProcedure objectIntProcedure) { @@ -260,18 +226,6 @@ else if (iterable != null) * Collection<Person> selected = * Iterate.select(people, person -> person.getAddress().getCity().equals("Metuchen")); * - *

- * Example using an anonymous inner class: - *

e.g.
-     * Collection<Person> selected =
-     *     Iterate.select(people, new Predicate<Person>()
-     *     {
-     *         public boolean accept(Person person)
-     *         {
-     *             return person.getAddress().getCity().equals("Metuchen");
-     *         }
-     *     });
-     * 
*/ public static Collection select(Iterable iterable, Predicate predicate) { @@ -309,18 +263,6 @@ public static Collection select(Iterable iterable, PredicateselectWith(people, (Person person, Integer age) -> person.getAge() >= age, Integer.valueOf(18)); * - *

- * Example using an anonymous inner class: - *

-     * Collection<Person> selected =
-     *      Iterate.selectWith(people, new Predicate2<Person, Integer>()
-     *     {
-     *         public boolean accept(Person person, Integer age)
-     *         {
-     *             return person.getAge() >= age;
-     *         }
-     *     }, Integer.valueOf(18));
-     * 
*/ public static Collection selectWith( Iterable iterable, @@ -362,18 +304,6 @@ public static Collection selectWith( * Twin<MutableList<Person>>selectedRejected = * Iterate.selectAndRejectWith(people, (Person person, String lastName) -> lastName.equals(person.getLastName()), "Mason"); * - *

- * Example using an anonymous inner class: - *

-     * Twin<MutableList<Person>>selectedRejected =
-     *      Iterate.selectAndRejectWith(people, new Predicate2<String, String>()
-     *      {
-     *          public boolean accept(Person person, String lastName)
-     *          {
-     *              return lastName.equals(person.getLastName());
-     *          }
-     *      }, "Mason");
-     * 
*/ public static Twin> selectAndRejectWith( Iterable iterable, @@ -407,18 +337,6 @@ public static Twin> selectAndRejectWith( * PartitionIterable<Person> newYorkersAndNonNewYorkers = * Iterate.partition(people, person -> person.getAddress().getState().getName().equals("New York")); * - *

- * Example using an anonymous inner class: - *

-     * PartitionIterable<Person> newYorkersAndNonNewYorkers =
-     *      Iterate.partition(people, new Predicate<Person>()
-     *      {
-     *          public boolean accept(Person person)
-     *          {
-     *              return person.getAddress().getState().getName().equals("New York");
-     *          }
-     *      });
-     * 
*/ public static PartitionIterable partition(Iterable iterable, Predicate predicate) { @@ -449,18 +367,6 @@ public static PartitionIterable partition(Iterable iterable, Predicate * PartitionIterable<Person> newYorkersAndNonNewYorkers = * Iterate.partitionWith(people, (Person person, String state) -> person.getAddress().getState().getName().equals(state), "New York"); * - *

- * Example using an anonymous inner class: - *

-     * PartitionIterable<Person> newYorkersAndNonNewYorkers =
-     *      Iterate.partitionWith(people, new Predicate<Person, String>()
-     *      {
-     *          public boolean accept(Person person, String state)
-     *          {
-     *              return person.getAddress().getState().getName().equals(state);
-     *          }
-     *      }, "New York");
-     * 
* * @since 5.0. */ @@ -523,17 +429,6 @@ public static Collection selectInstancesOf(Iterable iterable, Class *
      * int count = Iterate.count(people, person -> person.getAddress().getState().getName().equals("New York"));
      * 
- *

- * Example using anonymous inner class - *

-     * int count = Iterate.count(people, new Predicate<Person>()
-     * {
-     *     public boolean accept(Person person)
-     *     {
-     *         return person.getAddress().getState().getName().equals("New York");
-     *     }
-     * });
-     * 
*/ public static int count(Iterable iterable, Predicate predicate) { @@ -659,18 +554,6 @@ public static > R collectIf( * Iterate.select(people, person -> person.person.getLastName().equals("Smith"), FastList.newList()); * *

- * Example using anonymous inner class: - *

-     * MutableList<Person> selected =
-     *      Iterate.select(people, new Predicate<Person>()
-     *      {
-     *          public boolean accept(Person person)
-     *          {
-     *         return person.person.getLastName().equals("Smith");
-     *     }
-     * }, FastList.newList());
-     * 
- *

* Example using Predicates factory: *

      * MutableList<Person> selected = Iterate.select(collection, Predicates.attributeEqual("lastName", "Smith"), FastList.newList());
@@ -804,19 +687,6 @@ public static  Collection drop(Iterable iterable, int count)
      *      Iterate.reject(people, person -> person.person.getLastName().equals("Smith"));
      * 
*

- * Example using anonymous inner class: - *

-     * Collection<Person> rejected =
-     *      Iterate.reject(people,
-     *          new Predicate<Person>()
-     *          {
-     *              public boolean accept(Person person)
-     *              {
-     *                  return person.person.getLastName().equals("Smith");
-     *              }
-     *          });
-     * 
- *

* Example using Predicates factory: *

      * Collection<Person> rejected =
@@ -983,18 +853,6 @@ public static  boolean removeIfWith(
      * Collection<Person> rejected =
      *     Iterate.rejectWith(people, (Person person, Integer age) -> person.getAge() >= age, Integer.valueOf(18));
      * 
- *

- * Example using an anonymous inner class: - *

-     * Collection<Person> rejected =
-     *      Iterate.rejectWith(people, new Predicate2<Person, Integer>()
-     *     {
-     *         public boolean accept(Person person, Integer age)
-     *         {
-     *             return person.getAge() >= age;
-     *         }
-     *     }, Integer.valueOf(18));
-     * 
*/ public static Collection rejectWith( Iterable iterable, @@ -1037,21 +895,6 @@ public static Collection rejectWith( * Iterate.reject(people, person -> person.person.getLastName().equals("Smith"), FastList.newList()); * *

- * Example using anonymous inner class: - *

-     * MutableList<Person> rejected =
-     *      Iterate.reject(
-     *          people,
-     *          new Predicate<Person>()
-     *          {
-     *              public boolean accept(Person person)
-     *              {
-     *                  return person.person.getLastName().equals("Smith");
-     *              }
-     *          },
-     *          FastList.newList());
-     * 
- *

* Example using Predicates factory: *

      * MutableList<Person> rejected =
@@ -1176,20 +1019,6 @@ public static  boolean removeAllIterable(Iterable iterable, Coll
      * Collection<String> names =
      *      Iterate.collect(people, person -> person.getFirstName() + " " + person.getLastName());
      * 
- *

- * Example using an anonymous inner class: - *

-     * Collection<String> names =
-     *      Iterate.collect(
-     *          people,
-     *          new Function<Person, String>()
-     *          {
-     *              public String valueOf(Person person)
-     *              {
-     *                  return person.getFirstName() + " " + person.getLastName();
-     *              }
-     *          });
-     * 
*/ public static Collection collect( Iterable iterable, @@ -1232,21 +1061,6 @@ public static Collection collect( * MutableList<String> names = * Iterate.collect(people, person -> person.getFirstName() + " " + person.getLastName(), FastList.newList()); * - *

- * Example using an anonymous inner class: - *

-     * MutableList<String> names =
-     *      Iterate.collect(
-     *          people,
-     *          new Function<Person, String>()
-     *          {
-     *              public String valueOf(Person person)
-     *              {
-     *                  return person.getFirstName() + " " + person.getLastName();
-     *              }
-     *          },
-     *          FastList.newList());
-     * 
*/ public static > R collect( Iterable iterable, @@ -1280,20 +1094,6 @@ public static > R collect( * MutableBooleanCollection voters = * Iterable.collectBoolean(people, person -> person.canVote()); * - *

- * Example using anonymous inner class: - *

-     * MutableBooleanCollection voters =
-     *      Iterate.collectBoolean(
-     *          people,
-     *          new BooleanFunction<Person>()
-     *          {
-     *              public boolean booleanValueOf(Person person)
-     *              {
-     *                  return person.canVote();
-     *              }
-     *          });
-     * 
*/ public static MutableBooleanCollection collectBoolean( Iterable iterable, @@ -1327,21 +1127,6 @@ public static MutableBooleanCollection collectBoolean( * BooleanArrayList voters = * Iterable.collectBoolean(people, person -> person.canVote(), new BooleanArrayList()); * - *

- * Example using an anonymous inner class: - *

-     * BooleanArrayList voters =
-     *      Iterate.collectBoolean(
-     *          people,
-     *          new BooleanFunction<Person>()
-     *          {
-     *              public boolean booleanValueOf(Person person)
-     *              {
-     *                  return person.canVote();
-     *              }
-     *          },
-     *          new BooleanArrayList());
-     * 
*/ public static R collectBoolean( Iterable iterable, @@ -1375,20 +1160,6 @@ public static R collectBoolean( * MutableByteCollection bytes = * Iterate.collectByte(people, person -> person.getCode()); * - *

- * Example using anonymous inner class: - *

-     * MutableByteCollection bytes =
-     *      Iterate.collectByte(
-     *          people,
-     *          new ByteFunction<Person>()
-     *          {
-     *              public byte byteValueOf(Person person)
-     *              {
-     *                  return person.getCode();
-     *              }
-     *          });
-     * 
*/ public static MutableByteCollection collectByte( Iterable iterable, @@ -1422,21 +1193,6 @@ public static MutableByteCollection collectByte( * ByteArrayList bytes = * Iterate.collectByte(people, person -> person.getCode(), new ByteArrayList()); * - *

- * Example using an anonymous inner class: - *

-     * ByteArrayList bytes =
-     *      Iterate.collectByte(
-     *          people,
-     *          new ByteFunction<Person>()
-     *          {
-     *              public byte byteValueOf(Person person)
-     *              {
-     *                  return person.getCode();
-     *              }
-     *          },
-     *          new ByteArrayList());
-     * 
*/ public static R collectByte( Iterable iterable, @@ -1470,20 +1226,6 @@ public static R collectByte( * MutableCharCollection chars = * Iterate.collectChar(people, person -> person.getMiddleInitial()); * - *

- * Example using anonymous inner class: - *

-     * MutableCharCollection chars =
-     *      Iterate.collectChar(
-     *          people,
-     *          new CharFunction<Person>()
-     *          {
-     *              public char charValueOf(Person person)
-     *              {
-     *                  return person.getMiddleInitial();
-     *              }
-     *          });
-     * 
*/ public static MutableCharCollection collectChar( Iterable iterable, @@ -1516,21 +1258,6 @@ public static MutableCharCollection collectChar( * CharArrayList chars = * Iterate.collectChar(people, person -> person.getMiddleInitial()); * - *

- * Example using anonymous inner class: - *

-     * CharArrayList chars =
-     *      Iterate.collectChar(
-     *          people,
-     *          new CharFunction<Person>()
-     *          {
-     *              public char charValueOf(Person person)
-     *              {
-     *                  return person.getMiddleInitial();
-     *              }
-     *          },
-     *          new CharArrayList());
-     * 
*/ public static R collectChar( Iterable iterable, @@ -1564,18 +1291,6 @@ public static R collectChar( * MutableDoubleCollection doubles = * Iterate.collectDouble(people, person -> person.getMilesFromNorthPole()); * - * Example using an anonymous inner class: - *
-     * MutableDoubleCollection doubles =
-     *      Iterate.collectDouble(people,
-     *          new DoubleFunction<Person>()
-     *          {
-     *              public double doubleValueOf(Person person)
-     *              {
-     *                  return person.getMilesFromNorthPole();
-     *              }
-     *          });
-     * 
*/ public static MutableDoubleCollection collectDouble( Iterable iterable, @@ -1609,19 +1324,6 @@ public static MutableDoubleCollection collectDouble( * DoubleArrayList doubles = * Iterate.collectDouble(people, person -> person.getMilesFromNorthPole()); * - *

- * Example using an anonymous inner class: - *

-     * DoubleArrayList doubles =
-     *      Iterate.collectDouble(people,
-     *          new DoubleFunction<Person>()
-     *          {
-     *              public double doubleValueOf(Person person)
-     *              {
-     *                  return person.getMilesFromNorthPole();
-     *              }
-     *          }, new DoubleArrayList());
-     * 
*/ public static R collectDouble( Iterable iterable, @@ -1655,19 +1357,6 @@ public static R collectDouble( * MutableFloatCollection floats = * Iterate.collectFloat(people, person -> person.getHeightInInches()); * - *

- * Example using an anonymous inner class: - *

-     * MutableFloatCollection floats =
-     *      Iterate.collectFloat(people,
-     *          new FloatFunction<Person>()
-     *          {
-     *              public float floatValueOf(Person person)
-     *              {
-     *                  return person.getHeightInInches();
-     *              }
-     *          });
-     * 
*/ public static MutableFloatCollection collectFloat( Iterable iterable, @@ -1701,19 +1390,6 @@ public static MutableFloatCollection collectFloat( * FloatArrayList floats = * Iterate.collectFloat(people, person -> person.getHeightInInches(), new FloatArrayList()); * - *

- * Example using an anonymous inner class: - *

-     * FloatArrayList floats =
-     *      Iterate.collectFloat(people,
-     *          new FloatFunction<Person>()
-     *          {
-     *              public float floatValueOf(Person person)
-     *              {
-     *                  return person.getHeightInInches();
-     *              }
-     *          }, new FloatArrayList());
-     * 
*/ public static R collectFloat( Iterable iterable, @@ -1747,19 +1423,6 @@ public static R collectFloat( * MutableIntCollection ages = * Iterate.collectInt(people, person -> person.getAge()); * - *

- * Example using an anonymous inner class: - *

-     * MutableIntCollection ages =
-     *      Iterate.collectInt(people,
-     *          new IntFunction<Person>()
-     *          {
-     *              public int intValueOf(Person person)
-     *              {
-     *                  return person.getAge();
-     *              }
-     *          });
-     * 
*/ public static MutableIntCollection collectInt( Iterable iterable, @@ -1793,19 +1456,6 @@ public static MutableIntCollection collectInt( * IntArrayList ages = * Iterate.collectInt(people, person -> person.getAge(), new IntArrayList()); * - *

- * Example using an anonymous inner class: - *

-     * IntArrayList ages =
-     *      Iterate.collectInt(people,
-     *          new IntFunction<Person>()
-     *          {
-     *              public int intValueOf(Person person)
-     *              {
-     *                  return person.getAge();
-     *              }
-     *          }, new IntArrayList());
-     * 
*/ public static R collectInt( Iterable iterable, @@ -1839,19 +1489,6 @@ public static R collectInt( * MutableLongCollection longs = * Iterate.collectLong(people, person -> person.getGuid()); * - *

- * Example using an anonymous inner class: - *

-     * MutableLongCollection longs =
-     *      Iterate.collectLong(people,
-     *          new LongFunction<Person>()
-     *          {
-     *              public long longValueOf(Person person)
-     *              {
-     *                  return person.getGuid();
-     *              }
-     *          });
-     * 
*/ public static MutableLongCollection collectLong( Iterable iterable, @@ -1885,19 +1522,6 @@ public static MutableLongCollection collectLong( * LongArrayList longs = * Iterate.collectLong(people, person -> person.getGuid(), new LongArrayList()); * - *

- * Example using an anonymous inner class: - *

-     * LongArrayList longs =
-     *      Iterate.collectLong(people,
-     *              new LongFunction<Person>()
-     *              {
-     *                  public long longValueOf(Person person)
-     *                  {
-     *                      return person.getGuid();
-     *                  }
-     *              }, new LongArrayList());
-     * 
*/ public static R collectLong( Iterable iterable, @@ -1931,19 +1555,6 @@ public static R collectLong( * MutableShortCollection shorts = * Iterate.collectShort(people, person -> person.getNumberOfJunkMailItemsReceivedPerMonth()); * - *

- * Example using an anonymous inner class: - *

-     * MutableShortCollection shorts =
-     *      Iterate.collectShort(people,
-     *          new ShortFunction<Person>()
-     *          {
-     *              public short shortValueOf(Person person)
-     *              {
-     *                  return person.getNumberOfJunkMailItemsReceivedPerMonth();
-     *              }
-     *          });
-     * 
*/ public static MutableShortCollection collectShort( Iterable iterable, @@ -1977,19 +1588,6 @@ public static MutableShortCollection collectShort( * ShortArrayList shorts = * Iterate.collectShort(people, person -> person.getNumberOfJunkMailItemsReceivedPerMonth(), new ShortArrayList()); * - *

- * Example using an anonymous inner class: - *

-     * ShortArrayList shorts =
-     *      Iterate.collectShort(people,
-     *          new ShortFunction<Person>()
-     *          {
-     *              public short shortValueOf(Person person)
-     *              {
-     *                  return person.getNumberOfJunkMailItemsReceivedPerMonth();
-     *              }
-     *          }, new ShortArrayList());
-     * 
*/ public static R collectShort( Iterable iterable, @@ -2267,17 +1865,6 @@ public static T getLast(Iterable iterable) *
      * Person person = Iterate.detect(people, person -> person.getFirstName().equals("John") && person.getLastName().equals("Smith"));
      * 
- *

- * Example using an anonymous inner class: - *

-     * Person person = Iterate.detect(people, new Predicate<Person>()
-     * {
-     *     public boolean accept(Person person)
-     *     {
-     *         return person.getFirstName().equals("John") && person.getLastName().equals("Smith");
-     *     }
-     * });
-     * 
*/ public static T detect(Iterable iterable, Predicate predicate) { @@ -2308,17 +1895,6 @@ public static T detect(Iterable iterable, Predicate predicate) *
      * Person person = Iterate.detectWith(people, (person, fullName) -> person.getFullName().equals(fullName), "John Smith");
      * 
- *

- * Example using an anonymous inner class: - *

-     * Person person = Iterate.detectWith(people, new Predicate2<Person, String>()
-     * {
-     *     public boolean accept(Person person, String fullName)
-     *     {
-     *         return person.getFullName().equals(fullName);
-     *     }
-     * }, "John Smith");
-     * 
*/ public static T detectWith( Iterable iterable, @@ -3148,25 +2724,6 @@ public static > M addToMap( * MutableMultimap<String, String> multimap = * Iterate.toMultimap(integers, each -> "key:" + each, each -> Lists.mutable.of("value:" + each), FastListMultimap.newMultimap()); * - *

- * Example using an anonymous inner class: - *

-     * MutableMultimap<String, String> multimap =
-     *      Iterate.groupByAndCollect(integers,
-     *          new Function<Integer, String>()
-     *          {
-     *              public String valueOf(Integer each)
-     *              {
-     *                  return "key:" + each;
-     *              }
-     *          }, new Function<Integer, Iterable<String>>()
-     *          {
-     *              public Iterable<String> valueOf(Integer each)
-     *              {
-     *                  return Lists.mutable.of("value:" + each);
-     *              }
-     *          }, FastListMultimap.newMultimap());
-     * 
* * @see Iterate#groupBy(Iterable, Function) when only keys get transformed * @see Iterate#groupByEach(Iterable, Function) when only keys get transformed and Function returns multiple keys @@ -3465,25 +3022,6 @@ public static > R groupByEach( * MutableMultimap<String, String> multimap = * Iterate.groupByAndCollect(integers, each -> "key:" + each, each -> "value:" + each, FastListMultimap.newMultimap()); * - *

- * Example using an anonymous inner class: - *

-     * MutableMultimap<String, String> multimap =
-     *      Iterate.groupByAndCollect(integers,
-     *          new Function<Integer, String>()
-     *          {
-     *              public String valueOf(Integer each)
-     *              {
-     *                  return "key:" + each;
-     *              }
-     *          }, new Function<Integer, String>()
-     *          {
-     *              public String valueOf(Integer each)
-     *              {
-     *                  return "value:" + each;
-     *              }
-     *          }, FastListMultimap.newMultimap());
-     * 
* * @see Iterate#groupBy(Iterable, Function) when only keys get transformed * @see Iterate#groupByEach(Iterable, Function) when function returns multiple keys