public static Predicate<String> grep(final String pattern){
  Objects.requireNonNull(pattern,"The pattern must not be null");
  return contains(pattern);
}

public static Predicate < String > grep ( final String pattern ) { Objects . requireNonNull ( pattern , "The pattern must not be null" ) ; return contains ( pattern ) ; }
create a new predicate returning true when the input string contains the given pattern .
