@Test
  public void testUndefinedResultsAreReturnedWhenANotEqualsQueryIsExecuted() throws Exception {
    Portfolio p1 = new Portfolio(0);
    p1.position1 = null;
    region.put("0", p1);
    Portfolio p2 = new Portfolio(2);
    p2.position1 = null;
    region.put("2", p2);

    String query =
        "SELECT p.position1.secId FROM " + SEPARATOR + "pos p where p.position1.secId != 'MSFT' ";
    SelectResults[][] sr = new SelectResults[1][2];
    sr[0][0] = (SelectResults) qs.newQuery(query).execute();
    qs.removeIndexes();
    sr[0][1] = (SelectResults) qs.newQuery(query).execute();
    if (!CacheUtils.compareResultsOfWithAndWithoutIndex(sr)) {
      fail("Query results not same with and without index");
    }
  }
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