public void testCreateGroupWithDuplicateNameThrows() throws Exception
    {
        final String GROUP_NAME = "Test Group A";
        final GroupManager groupManager = GroupManager.getInstance();
        groupManager.createGroup(GROUP_NAME);
        assertThrows(GroupAlreadyExistsException.class, ()-> groupManager.createGroup(GROUP_NAME));
    }
Asserts that two groups with the same name cannot be created
xmppserver/src/test/java/org/jivesoftware/openfire/group/GroupManagerNoMockTest.java