public static boolean containsIgnoreCases(Collection<String> collection,String string){
  if (collection == null) {
    return false;
  }
  if (string == null) {
    return collection.contains(null);
  }
  boolean contains=false;
  for (  String element : collection) {
    if (string.equalsIgnoreCase(element)) {
      contains=true;
      break;
    }
  }
  return contains;
}

public static boolean containsIgnoreCases ( Collection < String > collection , String string ) { if ( collection == null ) { return false ; } if ( string == null ) { return collection . contains ( null ) ; } boolean contains = false ; for ( String element : collection ) { if ( string . equalsIgnoreCase ( element ) ) { contains = true ; break ; } } return contains ; }
this helper method makes up the shortage of contains method in collection to support the function of case insensitive contains . it only supports the string generic type of collection , cause other types have no cases concept .
