public static <E,L extends List<E>>L filter(L list,Predicate<E> predicate){
  for (Iterator<? extends E> iter=list.iterator(); iter.hasNext(); ) {
    E obj=iter.next();
    if (predicate.test(obj)) {
      iter.remove();
    }
  }
  return list;
}

public static < E , L extends List < E > > L filter ( L list , Predicate < E > predicate ) { for ( Iterator < ? extends E > iter = list . iterator ( ) ; iter . hasNext ( ) ; ) { E obj = iter . next ( ) ; if ( predicate . test ( obj ) ) { iter . remove ( ) ; } } return list ; }
remove from given list all elements that match given predicate .
