@SuppressWarnings("unchecked")
  public static <T> T[] removeValues(T[] values, Predicate<T> shouldRemove, Class<T> type) {
    Collection<T> collection = new ArrayList<>(values.length);
    for (T value : values) {
      if (shouldRemove.negate().test(value)) {
        collection.add(value);
      }
    }
    T[] array = (T[]) Array.newInstance(type, collection.size());
    return collection.toArray(array);
  }
@ SuppressWarnings ( "unchecked" ) public static < T > T [ ] removeValues ( T [ ] values , Predicate < T > shouldRemove , Class < T > type ) { Collection < T > collection = new ArrayList < > ( values . length ) ; for ( T value : values ) { if ( shouldRemove . negate ( ) . test ( value ) ) { collection . add ( value ) ; } } T [ ] array = ( T [ ] ) Array . newInstance ( type , collection . size ( ) ) ; return collection . toArray ( array ) ; }
Removes values from the array that meet the criteria for removal via the supplied
{@link Predicate} value