@Test
  public void testUpdateInProgressWithMethodInvocationInIndexClauseShouldNotThrowException()
      throws Exception {
    try {
      CompactRangeIndex.TEST_ALWAYS_UPDATE_IN_PROGRESS = true;
      index = utils.createIndex("indexName", "getP1().getSharesOutstanding()",
          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(
              "<trace>SELECT DISTINCT e.key FROM " + SEPARATOR
                  + "exampleRegion AS e WHERE e.ID = 1 AND e.getP1().getSharesOutstanding() >= -1 AND e.getP1().getSharesOutstanding() <= 1000 LIMIT 10 ")
          .execute();
    } finally {
      CompactRangeIndex.TEST_ALWAYS_UPDATE_IN_PROGRESS = false;
    }
  }
Tests race condition when we are transitioning index collection from elem array to concurrent
hash set The other thread could remove from the empty concurrent hash set. Instead we now set a
token, do all the puts into a collection and then unsets the token to the new collection
geode-core/src/integrationTest/java/org/apache/geode/cache/query/internal/index/CompactRangeIndexJUnitTest.java