@Override
    public boolean equals(Object o) {
      equalsInvocations.incrementAndGet();

      if (this == o) {
        return true;
      }

      if (!(o instanceof ArbitraryObject)) {
        return false;
      }

      ArbitraryObject that = (ArbitraryObject) o;

      return Objects.equals(id, that.id);
    }
Arbitrary Test class (equals method can not be mocked).
geode-core/src/test/java/org/apache/geode/cache/query/internal/types/TypeUtilsJUnitTest.java