int (@Nullable String s1, @Nullable String s2, boolean ignoreCase) { //noinspection StringEquality if (s1 == s2) return 0; if (s1 == null) return -1; if (s2 == null) return 1; return ignoreCase ? s1.compareToIgnoreCase(s2) : s1.compareTo(s2); }