question: 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 ; }
target:  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.