WorkbenchCloseHandlerImpl implements WorkbenchCloseHandler { @Override public void onWindowClosing(final ParameterizedCommand<Window.ClosingEvent> command) { this.onWindowClosing(command, null); }  @Override void onWindowClosing(final ParameterizedCommand<Window.ClosingEvent> command); @Override void onWindowClosing(final ParameterizedCommand<Window.ClosingEvent> command,
                                final Window.ClosingEvent event); @Override void onWindowClose(final Command command);  }
@Test public void onWindowClosingWithoutEventTest() { final ParameterizedCommand<Window.ClosingEvent> command = mock(ParameterizedCommand.class); workbenchCloseHandler.onWindowClosing(command); verify(command).execute(null); }
@Test public void onWindowClosingWithEventTest() { final ParameterizedCommand<Window.ClosingEvent> command = mock(ParameterizedCommand.class); final Window.ClosingEvent event = mock(Window.ClosingEvent.class); workbenchCloseHandler.onWindowClosing(command, event); verify(command).execute(event); }