UserAssignedGroupsExplorer extends UserAssignedEntitiesExplorer<Group> implements IsWidget,
                                                                                               org.uberfire.ext.security.management.client.editor.user.UserAssignedGroupsExplorer { @Override protected void removeEntity(String name) { Iterator<Group> groups = this.entities.iterator(); while (groups.hasNext()) { final Group g = groups.next(); if (g.getName().equals(name)) { groups.remove(); } } doShow(); removeUserGroupEventEvent.fire(new OnRemoveUserGroupEvent(UserAssignedGroupsExplorer.this, name)); } @Inject  UserAssignedGroupsExplorer(final ClientUserSystemManager userSystemManager,
                                      final ConfirmBox confirmBox,
                                      final GroupsList groupList,
                                      final AssignedEntitiesExplorer view,
                                      final Event<OnRemoveUserGroupEvent> removeUserGroupEventEvent);   }
@Test public void testRemoveGroup() { Group g = mock(Group.class); when(g.getName()).thenReturn("group1"); tested.entities.add(g); tested.removeEntity("group1"); assertFalse(tested.isEditMode); assertTrue(tested.entities.size() == 0); verify(groupList, times(1)).show(anySet(), any(EntitiesList.Callback.class)); verify(removeUserGroupEventEvent, times(1)).fire(any(OnRemoveUserGroupEvent.class)); verify(view, times(0)).configure(anyString(), any(EntitiesList.View.class)); verify(view, times(0)).clear(); verify(groupList, times(0)).clear(); }