@Override
  public int compare(String s1, String s2) {
    if (s1 == s2) { // NOSONAR false-positive: Compare Objects With Equals
      return 0;
    }
    int h1 = s1.hashCode();
    int h2 = s2.hashCode();
    if (h1 < h2) {
      return -1;
    } else if (h1 > h2) {
      return 1;
    } else {
      return s1.compareTo(s2);
    }
  }
@Test
  public void sameHashCode() {
    // Next two Strings have same hash code in Java - see http://www.drmaciver.com/2008/07/javalangstringhashcode/
    String s1 = "Od";
    String s2 = "PE";

    assertThat(s1).hasSameHashCodeAs(s2);
    assertThat(compare(s1, s2)).isNegative();
    assertThat(compare(s2, s1)).isPositive();
  }