public static <T extends Collection<String>>T removeMatching(String pattern,T strings){
  for (Iterator<String> iter=strings.iterator(); iter.hasNext(); ) {
    String s=iter.next();
    if (s.matches(pattern))     iter.remove();
  }
  return strings;
}

public static < T extends Collection < String > > T removeMatching ( String pattern , T strings ) { for ( Iterator < String > iter = strings . iterator ( ) ; iter . hasNext ( ) ; ) { String s = iter . next ( ) ; if ( s . matches ( pattern ) ) iter . remove ( ) ; } return strings ; }
removed from the collection all strings that match the given pattern . returns the modified collection , for easier chaining .
