@Test
  public void testNullMapValuesInIndexOnLocalRegionForCompactMap() throws Exception {
    region =
        CacheUtils.getCache().createRegionFactory(RegionShortcut.REPLICATE).create("portfolio");
    qs = CacheUtils.getQueryService();
    keyIndex1 = qs.createIndex(INDEX_NAME, "positions[*]", SEPARATOR + "portfolio ");

    Portfolio p = new Portfolio(1, 1);
    p.positions = new HashMap();
    region.put(1, p);

    Portfolio p2 = new Portfolio(2, 2);
    p2.positions = null;
    region.put(2, p2);

    Portfolio p3 = new Portfolio(3, 3);
    p3.positions = new HashMap();
    p3.positions.put("IBM", "something");
    p3.positions.put("SUN", null);
    region.put(3, p3);
    region.put(3, p3);

    SelectResults result = (SelectResults) qs
        .newQuery("select * from " + SEPARATOR + "portfolio p where p.positions['SUN'] = null")
        .execute();
    assertEquals(2, result.size());
  }
Test index object's comapreTo Function implementation correctness for indexes.
geode-core/src/integrationTest/java/org/apache/geode/cache/query/internal/index/MapRangeIndexMaintenanceJUnitTest.java