UberfireDocksImpl implements UberfireDocks { @Override public void remove(UberfireDock... docks) { for (UberfireDock dock : docks) { if (dock.getAssociatedPerspective() != null) { List<UberfireDock> uberfireDocks = docksPerPerspective.get(dock.getAssociatedPerspective()); uberfireDocks.remove(dock); docksPerPerspective.put(dock.getAssociatedPerspective(), uberfireDocks); } } clearAndCollapseDocks(docks); } @Inject  UberfireDocksImpl(DocksBars docksBars,
                             Event<UberfireDockReadyEvent> dockReadyEvent); @Override void add(UberfireDock... docks); void perspectiveChangeEvent(@Observes PerspectiveChange perspectiveChange); @Override void remove(UberfireDock... docks); @Override void open(UberfireDock dock); @Override void close(UberfireDock dock); @Override void toggle(UberfireDock dock); @Override void hide(UberfireDockPosition position,
                     String perspectiveName); @Override void show(UberfireDockPosition position,
                     String perspectiveName);  }
@Test public void remove() { uberfireDocks.add(dock0, dock1); when(docksBars.isReady(any())).thenReturn(true); uberfireDocks.currentPerspective = SOME_PERSPECTIVE; uberfireDocks.remove(dock0); verify(docksBars, times(2)).isReady(any()); verify(docksBars, times(1)).clearAndCollapseDocks(any()); verify(docksBars, never()).addDock(dock0); verify(docksBars, never()).addDock(dock1); }