### Question:
ExitCommandInterpreter implements CommandInterpreter { @Override public void run(final Command command, final org.semanticweb.rulewerk.commands.Interpreter interpreter) throws CommandExecutionException { this.shell.exitShell(); } ExitCommandInterpreter(final Shell shell); @Override void printHelp(final String commandName, final Interpreter interpreter); @Override String getSynopsis(); @Override void run(final Command command, final org.semanticweb.rulewerk.commands.Interpreter interpreter); static final Command EXIT_COMMAND; }### Answer:
@Test public void exitShell_succeeds() throws CommandExecutionException { final Interpreter interpreterMock = Mockito.mock(Interpreter.class); final Shell shell = new Shell(interpreterMock); final Shell shellSpy = Mockito.spy(shell); final ExitCommandInterpreter commandInterpreter = new ExitCommandInterpreter(shellSpy); commandInterpreter.run(Mockito.mock(Command.class), interpreterMock); Mockito.verify(shellSpy).exitShell(); }