public void testPaginatedSearch() throws Exception {
        final DefaultGroupProvider provider = new DefaultGroupProvider();
        for(int i=1; i<=9; i++){
            provider.createGroup("Test Group " + i);
        }

        final Collection<String> result = provider.search("Group", 4, 2);
        assertEquals(2, result.size());
        assertTrue(result.contains("Test Group 5"));
        assertTrue(result.contains("Test Group 6"));
    }
Verifies that {@link DefaultGroupProvider#search(String, int, int)} returns a subset of results
xmppserver/src/test/java/org/jivesoftware/openfire/group/DefaultGroupProviderTest.java