@Test
  public void testClientIndexUpdateWithRIOnPRRegion() throws Exception {

    CqQueryUsingPoolDUnitTest cqDUnitTest = new CqQueryUsingPoolDUnitTest();

    final Host host = Host.getHost(0);
    VM server = host.getVM(0);
    VM client = host.getVM(1);

    createServer(server, 0, true);

    final int port = server.invoke(QueryIndexUpdateRIDUnitTest::getCacheServerPort);
    final String host0 = NetworkUtils.getServerHostName(server.getHost());

    // Init values at server.
    final int size = 10;
    createValues(server, ROOT, size);

    String poolName = "testClientIndexUpdateWithRegisterInterest";
    cqDUnitTest.createPool(client, poolName, host0, port);

    // Create client.
    createClient(client, port, host0);
    // Create Index on client
    cqDUnitTest.createFunctionalIndex(client, "IdIndex", "p.ID", SEPARATOR + "root p");

    // Register Interest in all Keys on server
    registerInterestList(client, ROOT, size, 0);

    // Wait for Index to get updated.
    Wait.pause(5 * 1000);

    // This query execution should fail as it will run on client index and index are not updated
    // just by registerInterest.
    // Validate query results.
    validateQueryOnIndex(client, rootQ, size);

    // Close.
    cqDUnitTest.closeClient(client);
    cqDUnitTest.closeServer(server);
  }
This test tests the RegionClearedException Path in AbsractRegionMap while doing
initialImagePut() during registerInterest on client.
geode-cq/src/distributedTest/java/org/apache/geode/cache/query/dunit/QueryIndexUpdateRIDUnitTest.java