@Test
  public void testNullKeyCompactRangeIndex() throws Exception {
    index = utils.createIndex("indexName", "status", SEPARATOR + "exampleRegion");
    Region region = utils.getCache().getRegion("exampleRegion");

    // create objects
    int numObjects = 10;
    for (int i = 1; i <= numObjects; i++) {
      Portfolio p = new Portfolio(i);
      p.status = null;
      region.put("KEY-" + i, p);
    }
    // execute query and check result size
    QueryService qs = utils.getCache().getQueryService();
    SelectResults results = (SelectResults) qs
        .newQuery("Select * from " + SEPARATOR + "exampleRegion r where r.status = null").execute();
    assertEquals("Null matched Results expected", numObjects, results.size());
  }
Tests adding entries to compact range index where the key is null fixes bug 47151 where null
keyed entries would be removed after being added
geode-core/src/integrationTest/java/org/apache/geode/cache/query/internal/index/CompactRangeIndexJUnitTest.java