### Question:
WorkbenchUtils { public static <T> void addListListener(ObservableList<T> list, Consumer<T> addAction, Consumer<T> removeAction) { list.addListener((ListChangeListener<? super T>) c -> { while (c.next()) { if (!c.wasPermutated() && !c.wasUpdated()) { for (T remitem : c.getRemoved()) { removeAction.accept(remitem); } for (T additem : c.getAddedSubList()) { addAction.accept(additem); } } } }); } private  WorkbenchUtils(); static void assertNodeNotSame(Node node1, Node node2); static void addListListener(ObservableList<T> list,
      Consumer<T> addAction,
      Consumer<T> removeAction); static String convertToId(String name); static int calculateColumnsPerRow(int modulesPerPage);  }### Answer:
@Test void addSetListenerAdd() { Thread mock = mock(Thread.class); WorkbenchUtils.addListListener( observableList, c -> mock.run(), c -> fail("was removed instead of added") ); observableList.add("Test"); verify(mock).run(); }
@Test void addSetListenerRemove() { Thread mock = mock(Thread.class); String test = "Test"; observableList.add(test); WorkbenchUtils.addListListener( observableList, c -> fail("was added instead of removed"), c -> mock.run() ); observableList.remove(test); verify(mock).run(); }