@Test
  public void testAsyncIndexUpdaterThreadShutdownForRR() {
    Cache cache = new CacheFactory().set(MCAST_PORT, "0").create();

    RegionFactory rf = cache.createRegionFactory(RegionShortcut.REPLICATE);
    rf.setIndexMaintenanceSynchronous(false);
    Region localRegion = rf.create(name);

    assertNotNull("Region ref null", localRegion);

    try {
      cache.getQueryService().createIndex("idIndex", "ID", SEPARATOR + name);
    } catch (Exception e) {
      cache.close();
      e.printStackTrace();
      fail("Index creation failed");
    }

    for (int i = 0; i < 500; i++) {
      localRegion.put(i, new Portfolio(i));
    }

    InternalRegion internalRegion = (InternalRegion) localRegion;
    assertTrue(internalRegion.getIndexManager().getUpdaterThread().isAlive());

    localRegion.close();

    assertFalse(internalRegion.getIndexManager().getUpdaterThread().isAlive());

    cache.close();
  }
Test create a region (Replicated OR Partitioned) and sets index maintenance Asynchronous so that
{@link IndexManager} starts a new thread for index maintenance when region is populated. This
test verifies that after cache close {@link IndexUpdaterThread} is shutdown for each region
(Replicated/Bucket).
geode-core/src/integrationTest/java/org/apache/geode/cache/query/internal/index/AsyncIndexUpdaterThreadShutdownJUnitTest.java