@Test
  public void testUnregisterInterestAllKeys() throws Exception {
    server0.invoke(() -> UnregisterInterestDUnitTest.checkRIArtifacts(all_keys, 0, 0));
    client1.invoke(
        () -> UnregisterInterestDUnitTest.registerInterest(all_keys, receiveValuesConstant, null));
    client2.invoke(
        () -> UnregisterInterestDUnitTest.registerInterest(all_keys, !receiveValuesConstant, null));
    server0.invoke(() -> UnregisterInterestDUnitTest.checkRIArtifacts(all_keys, 1, 1));
    client1.invoke(UnregisterInterestDUnitTest::closeCache);
    client2.invoke(UnregisterInterestDUnitTest::closeCache);
    server0.invoke(() -> UnregisterInterestDUnitTest.checkRIArtifacts(all_keys, 0, 0));
  }
The test starts two clients who register interest in "ALL_KEYS" but close without unregistering
the same. The test then verifies that the server cleans up the register interest artifacts of
these clients properly.

See bug #47619
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/UnregisterInterestDUnitTest.java