@Test
  public void comparingArbitraryObjectsShouldDelegateToDefaultEqualsMethod()
      throws TypeMismatchException {
    ArbitraryObject aValue = new ArbitraryObject("0");
    ArbitraryObject anotherValue = new ArbitraryObject("1");
    NumericComparator numericComparator = spy(NumericComparator.class);
    TemporalComparator temporalComparator = spy(TemporalComparator.class);

    assertThat(TypeUtils.compare(aValue, aValue, OQLLexerTokenTypes.TOK_EQ))
        .isEqualTo(Boolean.TRUE);
    assertThat(TypeUtils.compare(aValue, aValue, OQLLexerTokenTypes.TOK_NE))
        .isEqualTo(Boolean.FALSE);
    assertThat(aValue.getInvocationsAmount()).isEqualTo(2);
    aValue.resetInvocationsAmount();

    assertThat(TypeUtils.compare(aValue, anotherValue, OQLLexerTokenTypes.TOK_NE))
        .isEqualTo(Boolean.TRUE);
    assertThat(TypeUtils.compare(anotherValue, aValue, OQLLexerTokenTypes.TOK_NE))
        .isEqualTo(Boolean.TRUE);
    assertThat(TypeUtils.compare(aValue, anotherValue, OQLLexerTokenTypes.TOK_EQ))
        .isEqualTo(Boolean.FALSE);
    assertThat(TypeUtils.compare(anotherValue, aValue, OQLLexerTokenTypes.TOK_EQ))
        .isEqualTo(Boolean.FALSE);
    assertThat(aValue.getInvocationsAmount()).isEqualTo(2);
    assertThat(anotherValue.getInvocationsAmount()).isEqualTo(2);
    aValue.resetInvocationsAmount();
    anotherValue.resetInvocationsAmount();

    // Extra check to verify that no other comparison methods were called.
    verify(numericComparator, times(0)).compare(any(), any());
    verify(temporalComparator, times(0)).compare(any(), any());
  }
Can't test every possible combination so try the known, relevant ones.
geode-core/src/test/java/org/apache/geode/cache/query/internal/types/TypeUtilsJUnitTest.java