code: public static <T, V> Collection<V> collect(
              Iterable<T> iterable,
              Function<? super T, ? extends V> function)
      {
          if (iterable instanceof MutableCollection)
          {
              return ((MutableCollection<T>) iterable).collect(function);
          }
          if (iterable instanceof ArrayList)
          {
              return ArrayListIterate.collect((ArrayList<T>) iterable, function);
          }
          if (iterable instanceof RandomAccess)
          {
              return RandomAccessListIterate.collect((List<T>) iterable, function);
          }
          if (iterable instanceof Collection)
          {
              return IterableIterate.collect(
                      iterable,
                      function,
                      DefaultSpeciesNewStrategy.INSTANCE.<V>speciesNew(
                              (Collection<T>) iterable,
                              ((Collection<T>) iterable).size()));
          }
          if (iterable != null)
          {
              return IterableIterate.collect(iterable, function);
          }
          throw new IllegalArgumentException("Cannot perform a collect on null");
      }
docs: Returns a new collection with the results of applying the specified function for each element of the iterable.
  <p>
  Example using a Java 8 lambda expression:
  <pre>
  Collection&lt;String&gt; names =
  Iterate.<b>collect</b>(people, person -> person.getFirstName() + " " + person.getLastName());
  </pre>
  <p>
  Example using an anonymous inner class:
  <pre>
  Collection&lt;String&gt; names =
  Iterate.<b>collect</b>(people,
  new Function&lt;Person, String&gt;()
  {
  public String value(Person person)
  {
  return person.getFirstName() + " " + person.getLastName();
  }
  });
  </pre>