@Test
  public void testUnregisterInterestPatterns() throws Exception {
    server0.invoke(() -> UnregisterInterestDUnitTest.checkRIArtifacts(regex, 0, 0));
    client1.invoke(UnregisterInterestDUnitTest.class, "registerInterest",
        new Object[] {regex, receiveValuesConstant, new String[] {"[a-z]*[0-9]"}});
    client2.invoke(UnregisterInterestDUnitTest.class, "registerInterest",
        new Object[] {regex, !receiveValuesConstant, new String[] {"[a-z]*[0-9]"}});
    server0.invoke(() -> UnregisterInterestDUnitTest.checkRIArtifacts(regex, 1, 1));
    client1.invoke(UnregisterInterestDUnitTest::closeCache);
    client2.invoke(UnregisterInterestDUnitTest::closeCache);
    server0.invoke(() -> UnregisterInterestDUnitTest.checkRIArtifacts(regex, 0, 0));
  }
The test starts two clients who register interest with regular expression "[a-z]*[0-9]" 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