ControllerMap implements Map<C, N> { public synchronized N removeWithController(C controller) { checkNotNull(controller, "The controller can not be null"); removeAllNodesFromObservable((N) controller.getRoot()); return controllerNodeMap.remove(controller); } ControllerMap(ObservableList<N> nodesList); synchronized N removeWithController(C controller); boolean removeWithNode(N node); boolean add(int index, C controller); boolean add(C controller); boolean addAll(int index, Collection<C> controllers); boolean addAll(Collection<C> controllers); boolean addAll(C... controllers); C getWithNode(N node); @SuppressWarnings("PMD.CompareObjectsWithEquals") void moveByDistance(C controller, int distance); @Override N put(C key, N value); @Override int size(); @Override boolean isEmpty(); @Override boolean containsKey(Object key); @Override boolean containsValue(Object value); @Override N get(Object key); @Override N remove(Object key); @Override void putAll(Map<? extends C, ? extends N> m); @Override void clear(); @Override Set<C> keySet(); @Override Collection<N> values(); @Override Set<Entry<C, N>> entrySet(); void sort(Comparator<? super C> c);  }
@Test @SuppressWarnings("PMD.JUnitTestsShouldIncludeAssert") public void testRemoveWithController() throws Exception { interact(() -> { final MockController mockController = new MockController(); mockPane.controllerMap.add(mockController); mockPane.controllerMap.removeWithController(mockController); assertEquals("The size of the controller was not 0 after removed with pane", 0, mockPane .controllerMap.size()); }); }