public static <T>boolean remove(Collection<T> collection,T element){
  if (element == null) {
    return false;
  }
  if (CollectionUtils.isEmpty(collection)) {
    return false;
  }
  return collection.remove(element);
}

public static < T > boolean remove ( Collection < T > collection , T element ) { if ( element == null ) { return false ; } if ( CollectionUtils . isEmpty ( collection ) ) { return false ; } return collection . remove ( element ) ; }
safe method to remove an element from collection . if either collection is empty or element is null - returns false .
