@Test
  public void testIncorrectIndexOperatorSyntax() {
    QueryService qs = CacheUtils.getQueryService();
    LocalRegion testRgn = (LocalRegion) CacheUtils.createRegion("testRgn", null);
    int ID = 1;
    // Add some test data now
    // Add 5 main objects. 1 will contain key1, 2 will contain key1 & key2
    // and so on
    for (; ID <= 30; ++ID) {
      MapKeyIndexData mkid = new MapKeyIndexData(ID);
      for (int j = 1; j <= ID; ++j) {
        mkid.maap.put("key1", j * 1);
        mkid.maap.put("key2", j * 2);
        mkid.maap.put("key3", j * 3);
      }
      testRgn.put(ID, mkid);
    }

    qs = CacheUtils.getQueryService();
    try {
      Query q = CacheUtils.getQueryService()
          .newQuery(
              "SELECT DISTINCT * FROM " + SEPARATOR + "testRgn itr1  WHERE itr1.maap[*] >= 3");
      fail("Should have thrown exception");
    } catch (QueryInvalidException expected) {
      // ok
    }

    try {
      Query q = CacheUtils.getQueryService()
          .newQuery("SELECT DISTINCT * FROM " + SEPARATOR
              + "testRgn itr1  WHERE itr1.maap['key1','key2'] >= 3");
      fail("Should have thrown exception");
    } catch (QueryInvalidException expected) {
      // ok
    }
  }
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