@Test
  void closeInactiveModule() {
    robot.interact(() -> {
      workbench.openModule(first);
      workbench.openModule(second);
      workbench.openModule(last);
      workbench.closeModule(second);

      assertSame(last, workbench.getActiveModule());
      assertSame(moduleNodes[LAST_INDEX], workbench.getActiveModuleView());
      assertEquals(2, workbench.getOpenModules().size());

      InOrder inOrder = inOrder(first, second, last);
      // Call: workbench.openModule(first)
      inOrder.verify(first).init(workbench);
      inOrder.verify(first).activate();
      // Call: workbench.openModule(second)
      inOrder.verify(first).deactivate();
      inOrder.verify(second).init(workbench);
      inOrder.verify(second).activate();
      // Call: workbench.openModule(last)
      inOrder.verify(second).deactivate();
      inOrder.verify(last).init(workbench);
      inOrder.verify(last).activate();
      // Call: workbench.closeModule(second)
      inOrder.verify(second, never()).deactivate();
      inOrder.verify(second).destroy();
      inOrder.verify(last).getWorkbench();
      inOrder.verify(last).getName();
      inOrder.verify(last).getIcon();

      ignoreModuleGetters(first, second, last);
      verifyNoMoreInteractions(first, second, last);
    });
  }
Example of what happens in case of a closing dialog in the destroy() method of a module with
the user confirming the module should NOT get closed. Precondition: openModule tests pass.
workbenchfx-core/src/test/java/com/dlsc/workbenchfx/WorkbenchTest.java