Strings { public static int compare(@Nullable String text1, @Nullable String text2) { if (text1 == null && text2 == null) return 0; if (text1 != null && text2 == null) return 1; if (text1 == null) return -1; return text1.compareTo(text2); }  static byte[] bytes(String text); static String format(String pattern, Object... params); static int compare(@Nullable String text1, @Nullable String text2); static boolean isBlank(@Nullable String text); static boolean equals(@Nullable String text1, @Nullable String text2); @Nullable static String truncate(@Nullable String text, int maxLength); @Nullable static String strip(@Nullable String text); static boolean startsWith(String text, char prefix); static String[] split(String text, char delimiter);  }
@Test void compare() { assertThat(Strings.compare(null, "")).isEqualTo(-1); assertThat(Strings.compare("b", "a")).isEqualTo(1); assertThat(Strings.compare(null, null)).isZero(); }