@Test
  public void comparingNumericValuesIsEnabled() {
    // Can't spy final classes, nor primitives.
    long lLong = Short.MIN_VALUE;
    long hLong = Short.MAX_VALUE;
    int lInteger = Short.MIN_VALUE;
    int hInteger = Short.MAX_VALUE;
    float lFloat = Short.MIN_VALUE;
    float hFloat = Short.MAX_VALUE;
    short lShort = Short.MIN_VALUE;
    short hShort = Short.MAX_VALUE;
    double lDouble = Short.MIN_VALUE;
    double hDouble = Short.MAX_VALUE;
    Long lowestLong = (long) Short.MIN_VALUE;
    Long highestLong = (long) Short.MAX_VALUE;
    Float lowestFloat = (float) Short.MIN_VALUE;
    Float highestFloat = (float) Short.MAX_VALUE;
    Short lowestShort = Short.MIN_VALUE;
    Short highestShort = Short.MAX_VALUE;
    Double lowestDouble = (double) Short.MIN_VALUE;
    Double highestDouble = (double) Short.MAX_VALUE;
    Integer lowestInteger = (int) Short.MIN_VALUE;
    Integer highestInteger = (int) Short.MAX_VALUE;
    AtomicLong lowestAtomicLong = new AtomicLong(Short.MIN_VALUE);
    AtomicLong highestAtomicLong = new AtomicLong(Short.MAX_VALUE);
    BigDecimal lowestBigDecimal = BigDecimal.valueOf(Short.MIN_VALUE);
    BigDecimal highestBigDecimal = BigDecimal.valueOf(Short.MAX_VALUE);
    BigInteger lowestBigInteger = BigInteger.valueOf(Short.MIN_VALUE);
    BigInteger highestBigInteger = BigInteger.valueOf(Short.MAX_VALUE);
    AtomicInteger lowestAtomicInteger = new AtomicInteger(Short.MIN_VALUE);
    AtomicInteger highestAtomicInteger = new AtomicInteger(Short.MAX_VALUE);

    List<Number> lowestNumbers = Arrays.asList(lInteger, lLong, lFloat, lShort, lDouble, lowestLong,
        lowestFloat, lowestShort, lowestDouble, lowestInteger, lowestAtomicLong, lowestBigDecimal,
        lowestBigInteger, lowestAtomicInteger);
    List<Number> highestNumbers = Arrays.asList(hInteger, hLong, hFloat, hShort, hDouble,
        highestLong, highestFloat, highestShort, highestDouble, highestInteger, highestAtomicLong,
        highestBigDecimal, highestBigInteger, highestAtomicInteger);

    lowestNumbers.forEach(lowest -> lowestNumbers.stream()
        .filter(number -> number.getClass() != lowest.getClass()).forEach((lowest2) -> {
          try {
            assertThat(TypeUtils.compare(lowest, lowest2, OQLLexerTokenTypes.TOK_EQ))
                .isEqualTo(Boolean.TRUE);
            assertThat(TypeUtils.compare(lowest, lowest2, OQLLexerTokenTypes.TOK_LT))
                .isEqualTo(Boolean.FALSE);
            assertThat(TypeUtils.compare(lowest, lowest2, OQLLexerTokenTypes.TOK_NE))
                .isEqualTo(Boolean.FALSE);
            assertThat(TypeUtils.compare(lowest, lowest2, OQLLexerTokenTypes.TOK_LE))
                .isEqualTo(Boolean.TRUE);
            assertThat(TypeUtils.compare(lowest, lowest2, OQLLexerTokenTypes.TOK_GT))
                .isEqualTo(Boolean.FALSE);
            assertThat(TypeUtils.compare(lowest, lowest2, OQLLexerTokenTypes.TOK_GE))
                .isEqualTo(Boolean.TRUE);
          } catch (TypeMismatchException typeMismatchException) {
            throw new RuntimeException(typeMismatchException);
          }
        }));

    lowestNumbers.forEach(lowestNumber -> highestNumbers.stream()
        .filter(number -> number.getClass() != lowestNumber.getClass()).forEach((highestNumber) -> {
          try {
            assertThat(TypeUtils.compare(lowestNumber, highestNumber, OQLLexerTokenTypes.TOK_EQ))
                .isEqualTo(Boolean.FALSE);
            assertThat(TypeUtils.compare(lowestNumber, highestNumber, OQLLexerTokenTypes.TOK_LT))
                .isEqualTo(Boolean.TRUE);
            assertThat(TypeUtils.compare(lowestNumber, highestNumber, OQLLexerTokenTypes.TOK_GT))
                .isEqualTo(Boolean.FALSE);
            assertThat(TypeUtils.compare(lowestNumber, highestNumber, OQLLexerTokenTypes.TOK_LE))
                .isEqualTo(Boolean.TRUE);
            assertThat(TypeUtils.compare(lowestNumber, highestNumber, OQLLexerTokenTypes.TOK_GE))
                .isEqualTo(Boolean.FALSE);
            assertThat(TypeUtils.compare(lowestNumber, highestNumber, OQLLexerTokenTypes.TOK_NE))
                .isEqualTo(Boolean.TRUE);
          } catch (TypeMismatchException typeMismatchException) {
            throw new RuntimeException(typeMismatchException);
          }
        }));

    highestNumbers.forEach(highestNumber -> lowestNumbers.stream()
        .filter(number -> number.getClass() != highestNumber.getClass()).forEach((lowestNumber) -> {
          try {
            assertThat(TypeUtils.compare(highestNumber, lowestNumber, OQLLexerTokenTypes.TOK_EQ))
                .isEqualTo(Boolean.FALSE);
            assertThat(TypeUtils.compare(highestNumber, lowestNumber, OQLLexerTokenTypes.TOK_LT))
                .isEqualTo(Boolean.FALSE);
            assertThat(TypeUtils.compare(highestNumber, lowestNumber, OQLLexerTokenTypes.TOK_LE))
                .isEqualTo(Boolean.FALSE);
            assertThat(TypeUtils.compare(highestNumber, lowestNumber, OQLLexerTokenTypes.TOK_NE))
                .isEqualTo(Boolean.TRUE);
            assertThat(TypeUtils.compare(highestNumber, lowestNumber, OQLLexerTokenTypes.TOK_GT))
                .isEqualTo(Boolean.TRUE);
            assertThat(TypeUtils.compare(highestNumber, lowestNumber, OQLLexerTokenTypes.TOK_GE))
                .isEqualTo(Boolean.TRUE);
          } catch (TypeMismatchException typeMismatchException) {
            throw new RuntimeException(typeMismatchException);
          }
        }));
  }
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