@Test
  public void testSizeEstimateLTInCompactRangeIndexForNullMap() throws Exception {
    QueryService qs = CacheUtils.getQueryService();
    LocalRegion testRgn = (LocalRegion) CacheUtils.createRegion("testRgn", null);
    // Create indexes
    Index i1 = qs.createIndex("Index1", IndexType.FUNCTIONAL, "p.status", SEPARATOR + "testRgn p");
    Index i2 = qs.createIndex("Index2", IndexType.FUNCTIONAL, "p.ID", SEPARATOR + "testRgn p");

    // put values
    testRgn.put(0, new Portfolio(0));
    testRgn.put(1, new Portfolio(1));

    // Set TestHook in RangeIndex
    TestHook hook = new RangeIndexTestHook();
    CompactRangeIndex.setTestHook(hook);
    // Execute Queries without Indexes
    Query q = CacheUtils.getQueryService()
        .newQuery("<trace> SELECT * FROM " + SEPARATOR
            + "testRgn p where p.status = 'active' AND p.ID > 0 ");

    // Following should throw NullPointerException.
    SelectResults sr = (SelectResults) q.execute();

    assertTrue("RangeIndexTestHook was not hooked for spot 2",
        ((RangeIndexTestHook) hook).isHooked(2));
    CompactRangeIndex.setTestHook(null);
  }
Test to check if Region short cut method is used for querying, the Primary key index
utilization occurs or not
geode-core/src/integrationTest/java/org/apache/geode/cache/query/internal/index/IndexUseJUnitTest.java