@Test
  public void testClientIndexUpdateWithRIOnOverlapKeys() 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, false);

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

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

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

    final int size = 10;
    // Init values at client
    createValues(client, cqDUnitTest.regions[0], size, 1);

    // wait for index to get updated.
    Wait.pause(5 * 1000);
    // this.validateQueryOnIndex(client, incompleteQ+"p.getID() > 0", 10);

    validateQueryOnIndex(client, incompleteQ + "p.ID > 0", 10);

    // Init values at server.
    createValues(server, cqDUnitTest.regions[0], size, 4 /* start index */);

    // Register Interest in all Keys on server
    registerInterestList(client, cqDUnitTest.regions[0], size, KEYS, 4 /* start index */);

    // 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, incompleteQ + "p.ID < " + 4 * 4, 3);
    validateQueryOnIndex(client, incompleteQ + "p.ID >= 16", 7);

    // Close.
    cqDUnitTest.closeClient(client);
    cqDUnitTest.closeServer(server);
  }
Tests overlap keys between client region and server region to verify the server region values
are synched with client region on register interest.
geode-cq/src/distributedTest/java/org/apache/geode/cache/query/dunit/QueryIndexUpdateRIDUnitTest.java