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

public static < E > boolean removeElement ( List < ? extends E > list , Predicate < E > predicate ) { for ( Iterator < ? extends E > iter = list . iterator ( ) ; iter . hasNext ( ) ; ) { E obj = iter . next ( ) ; if ( predicate . test ( obj ) ) { iter . remove ( ) ; return true ; } } return false ; }
removes from given list the first element that matches given predicate .
