@Test
public void testGetRequiredMembers() throws IOException {

    Group group1 = Mockito.mock(Group.class);
    Mockito.when(group1.getType()).thenReturn(Role.GROUP);
    Mockito.when(group1.getName()).thenReturn("group1");
    User user1 = Mockito.mock(Group.class);
    Mockito.when(user1.getName()).thenReturn("user1");
    Mockito.when(group1.getRequiredMembers()).thenReturn(new Role[] { user1 });
    Mockito.when(userAdmin.getRole("group1")).thenReturn(group1);
    String[] members = mbean.getRequiredMembers("group1");
    Assert.assertArrayEquals(new String[] { "user1" }, members);
}