public static boolean compareCaseInsensitiveString(String s1,String s2){
  return s1 == null ? s2 == null : s1.equalsIgnoreCase(s2);
}

public static boolean compareCaseInsensitiveString ( String s1 , String s2 ) { return s1 == null ? s2 == null : s1 . equalsIgnoreCase ( s2 ) ; }
compares two strings in a case insensitive manner , that also allows for either of the strings to be null , without issue .
