private <T extends AbstractIndex> void verifyStatsForQueriesForValueInMapFieldWithAnyRangeIndexWithOneKey(
      Class<T> indexType) {
    long keys = (indexType.cast(keyIndex1)).internalIndexStats.getNumberOfKeys();
    long mapIndexKeys =
        (indexType.cast(keyIndex1)).internalIndexStats.getNumberOfMapIndexKeys();
    long values =
        (indexType.cast(keyIndex1)).internalIndexStats.getNumberOfValues();
    long uses =
        (indexType.cast(keyIndex1)).internalIndexStats.getTotalUses();

    // The number of keys must be equal to the number of different values the
    // positions map takes in region entries for the 'SUN' key:
    // ("nothing", "more"). null or UNDEFINED not included.
    assertThat(keys).isEqualTo(2);
    // mapIndexKeys must be zero because the index used is a range index and not a map index.
    assertThat(mapIndexKeys).isEqualTo(0);
    // The number of values must be equal to the number of region entries.
    assertThat(values).isEqualTo(region.keySet().size());
    // The index must be used in all the queries that have positions['SUN'] in the filter.
    assertThat(uses).isEqualTo(4);
  }
Test index object's comapreTo Function implementation correctness for indexes.
geode-core/src/integrationTest/java/org/apache/geode/cache/query/internal/index/MapRangeIndexMaintenanceJUnitTest.java