UberfireDocksImpl implements UberfireDocks { @Override public void add(UberfireDock... docks) { for (UberfireDock dock : docks) { if (dock.getAssociatedPerspective() != null) { List<UberfireDock> uberfireDocks = docksPerPerspective.get(dock.getAssociatedPerspective()); if (uberfireDocks == null) { uberfireDocks = new ArrayList<>(); } uberfireDocks.add(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 add() { uberfireDocks.add(dock0, dock1, dock2, dock3, dock4); List<UberfireDock> docksSomePerspective = uberfireDocks.docksPerPerspective.get(SOME_PERSPECTIVE); List<UberfireDock> docksAnotherPerspective = uberfireDocks.docksPerPerspective.get(ANOTHER_PERSPECTIVE); assertEquals(3, docksSomePerspective.size()); assertEquals(2, docksAnotherPerspective.size()); }