MenuActions { @SuppressWarnings("UnusedParameters") protected void showInspector(ActionEvent actionEvent) { if (inspector == null) { inspector = new InspectorWindow(overlay); } inspector.show(); } MenuActions(final MainOverlay ol, final ToplevelPane tl);   }
@Test public void showInspectorTest() throws Exception { ToplevelPane mockToplevelPane = mock(ToplevelPane.class); InspectorWindow mockInspectorWindow = mock(InspectorWindow.class); whenNew(InspectorWindow.class).withArguments(any()).thenReturn(mockInspectorWindow); MenuActions menuActions = new MenuActions(mockMainOverlay, mockToplevelPane); menuActions.showInspector(mockEvent); verify(mockInspectorWindow, times(1)).show(); }