@Test
    public void testReflectedInCacheMemberRemoved() throws Exception
    {
        // Setup test fixture.
        final String groupName = "unit-test-group-f";
        final Group group = groupManager.createGroup(groupName);
        final JID testUser = new JID("unit-test-user-f", "example.org", null);
        group.getMembers().add(testUser);

        // Execute system under test.
        group.getMembers().remove(testUser);
        final CacheableOptional<Group> cachedGroup = groupCache.get(groupName);

        // Verify results.
        assertFalse(cachedGroup.get().isUser(testUser));
        assertFalse(cachedGroup.get().getMembers().contains(testUser));
    }
Verifies that the group contained in the Group cache no longer contains a member user after it has been removed from the group.
xmppserver/src/test/java/org/jivesoftware/openfire/group/GroupTest.java