### Question:
SavePreferencesCommand implements ICommand { public void execute() { _app.saveApplicationState(); dialogUtils.showOk(_frame, s_stringMgr.getString("SavePreferencesCommand.allPrefsSavedMsg")); } SavePreferencesCommand(IApplication app, Frame frame); void setDialogUtils(IDialogUtils utils); void execute();  }### Answer:
@Test public final void testExecute() { mockApplication.saveApplicationState(); mockDialogUtils.showOk(isA(Component.class), isA(String.class)); replay(mockFrame); replay(mockApplication); replay(mockDialogUtils); SavePreferencesCommand command = new SavePreferencesCommand(mockApplication, mockFrame); command.setDialogUtils(mockDialogUtils); command.execute(); verify(mockFrame); verify(mockApplication); verify(mockDialogUtils); }