@Test
public void testGetGroups() throws NamingException {

  // The search functionality of the mock context is reused, so we will
  // return the user NamingEnumeration first, and then the group
  when(getContext().search(anyString(), anyString(), any(Object[].class),
      any(SearchControls.class)))
      .thenReturn(getUserNames(), getGroupNames());
  doTestGetGroups(Arrays.asList(getTestGroups()), 2);
}