public static boolean areStringsEqual(String s1, String s2) {
    return s1 != null && s1.equals(s2) || s1 == null && s2 == null;
  }
public static boolean areStringsEqual ( String s1 , String s2 ) { return s1 != null && s1 . equals ( s2 ) || s1 == null && s2 == null ; }
null-safe string equality test. If both s1 and s2 are null, returns true.