@Test
    public void testEventListenerInvokedMemberAdded() throws Exception
    {
        // Setup test fixture.
        final String groupName = "unit-test-group-c";
        final Group group = groupManager.createGroup(groupName);
        final JID testUser = new JID("unit-test-user-c", "example.org", null);
        final RecordingGroupEventListener listener = new RecordingGroupEventListener();
        GroupEventDispatcher.addListener(listener);

        // Execute system under test.
        group.getMembers().add(testUser);

        // Verify results.
        assertEquals(groupName, listener.lastGroupMemberAdded);
        assertEquals(testUser.toString(), listener.lastParams.get("member"));
    }
Verifies that the corresponding event listener has been invoked after a user has been added to a group as a member.
xmppserver/src/test/java/org/jivesoftware/openfire/group/GroupTest.java