public boolean equals(Object obj) {
      if (obj instanceof MyComparator) {
        MyComparator other = (MyComparator) obj;
        return id == other.id;
      }
      return false;
    }
Tests data serializing an {@link TreeMap}
geode-core/src/test/java/org/apache/geode/internal/DataSerializableJUnitTest.java