@Nonnull
  @ReturnsMutableCopy
  public static <SRCTYPE, ELEMENTTYPE> CommonsArrayList <ELEMENTTYPE> createFiltered (@Nullable final Iterable <? extends SRCTYPE> aValues,
                                                                                      @Nullable final Predicate <? super SRCTYPE> aFilter,
                                                                                      @Nonnull final Function <? super SRCTYPE, ? extends ELEMENTTYPE> aMapper)
  {
    final CommonsArrayList <ELEMENTTYPE> ret = new CommonsArrayList <> (ArrayHelper.getSize (aValues));
    ret.addAllMapped (aValues, aFilter, aMapper);
    return ret;
  }
@ Nonnull @ ReturnsMutableCopy public static < SRCTYPE , ELEMENTTYPE > CommonsArrayList < ELEMENTTYPE > createFiltered ( @ Nullable final Iterable < ? extends SRCTYPE > aValues , @ Nullable final Predicate < ? super SRCTYPE > aFilter , @ Nonnull final Function < ? super SRCTYPE , ? extends ELEMENTTYPE > aMapper ) { final CommonsArrayList < ELEMENTTYPE > ret = new CommonsArrayList < > ( ArrayHelper . getSize ( aValues ) ) ; ret . addAllMapped ( aValues , aFilter , aMapper ) ; return ret ; }
Create a new array list that contains a subset of the provided iterable.
This method filters the elements before they are mapped.<br>
Note: this method is a static factory method because the compiler sometimes
cannot deduce between {@link Predicate} and {@link Function} and the
mapping case occurs more often.

@param aValues
The iterable from which the elements are copied from. May be
<code>null</code>.
@param aFilter
The filter to be applied to check if the element should be added or
not.
@param aMapper
The mapping function to be executed for all provided elements. May
not be <code>null</code>.
@return The created array list. Never <code>null</code>.
@see #addAllMapped(Iterable, Predicate, Function)