@Test()
    public void testCreateDuplicateGroup() throws Exception
    {
        // Setup test fixture.
        HybridGroupProvider.PRIMARY_PROVIDER.setValue(TestGroupProvider.NoGroupProvider.class);
        HybridGroupProvider.SECONDARY_PROVIDER.setValue(TestGroupProvider.LittleEndiansGroupProvider.class);
        HybridGroupProvider.TERTIARY_PROVIDER.setValue(TestGroupProvider.BigEndiansGroupProvider.class);
        final HybridGroupProvider provider = new HybridGroupProvider();

        // Execute system under test & Verify results.
        assertThrows(GroupAlreadyExistsException.class, () -> provider.createGroup("little-endians"));
    }
Verifies that an exception is thrown when a new group is being created, using a groupname that is not unique.
xmppserver/src/test/java/org/jivesoftware/openfire/group/HybridGroupProviderTest.java