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

public static boolean equalsNullSafe ( String s1 , String s2 ) { return s1 == null ? s2 == null : s1 . equals ( s2 ) ; }
checks the two strings for equality .
