@Test
  void closeModuleInvalid() {
    robot.interact(() -> {
      // Test for null
      assertThrows(NullPointerException.class, () -> workbench.closeModule(null));
      // Test if closing a module not included in the modules at all throws an exception
      assertThrows(IllegalArgumentException.class,
          () -> workbench.closeModule(mock(WorkbenchModule.class)));
      // Test if closing a module not opened throws an exception
      assertThrows(IllegalArgumentException.class, () -> workbench.closeModule(mockModules[0]));
    });
  }
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