private <T extends AbstractMapIndex> void verifyStatsForQueriesForValueInMapFieldWithAnyMapIndexWithSeveralKeys(
      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 for the 'SUN' key ("nothing", "more") plus
    // the number of different values the positions map takes for the 'ERICSSON' key
    // ("hey"). null or UNDEFINED not included.
    assertThat(keys).isEqualTo(3);
    // The number of mapIndexKeys must be equal to the number of keys
    // in the index that appear in region entries:
    // 'SUN', 'ERICSSON'
    assertThat(mapIndexKeys).isEqualTo(2);
    // The number of values must be equal to the number of entries
    // in the region times the number of indexed keys in the map: 'SUN', 'ERICSSON'.
    assertThat(values).isEqualTo(region.keySet().size() * 2L);
    // 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