@Test
  public void testRebalanceWithIndex() throws Exception {
    vm0.invoke(this::createAccessor);
    vm1.invoke(this::createPartitionedRegion);
    vm2.invoke(this::createPartitionedRegion);

    vm1.invoke(() -> createIndex(INDEX_NAME, "r.score", SEPARATOR + regionName + " r"));

    // Do Puts
    vm1.invoke("putting data", () -> {
      Region region = cacheRule.getCache().getRegion(regionName);
      for (int i = 0; i < 2000; i++) {
        region.put(i, new TestObject(i));
      }
    });

    vm3.invoke(this::createPartitionedRegion);

    // Rebalance
    vm1.invoke("rebalance", () -> {
      cacheRule.getCache().getResourceManager().createRebalanceFactory().start().getResults();
    });

    vm1.invoke(() -> checkForLingeringBucketIndexes(INDEX_NAME));
    vm2.invoke(() -> checkForLingeringBucketIndexes(INDEX_NAME));
  }
1. Indexes and Buckets are created on several nodes <br>
2. Buckets are moved <br>
3. Check to make sure we don't have lingering bucket indexes with bucket regions already
destroyed
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PRWithIndexAfterRebalanceRegressionTest.java