code: public static int compareStrings(final String s1, final String s2) {
      if (s1 == null) {
        if (s2 != null) {
          return -1;
        }
  
        return 0;
      }
  
      if (s2 == null) {
        return 1;
      }
  
      return s1.compareTo(s2);
    }
docs: Compare two strings. null is less than any non-null string.
  
  @param s1       first string.
  @param s2       second string.
  @return int     0 if the s1 is equal to s2;
  <0 if s1 is lexicographically less than s2;
  >0 if s1 is lexicographically greater than s2.