Group group1 = Mockito.mock(Group.class);
User user1 = Mockito.mock(User.class);
Mockito.when(userAdmin.getRole("group1")).thenReturn(group1);
Mockito.when(userAdmin.getRole("user1")).thenReturn(user1);
Mockito.when(group1.getType()).thenReturn(Role.GROUP);
Mockito.when(group1.addMember(user1)).thenReturn(true);
boolean isAdded = mbean.addMember("group1", "user1");
Assert.assertTrue(isAdded);
Mockito.verify(group1).addMember(user1);
}