RetryCommand extends Command { List<String> getCommandToExecute() { int indexOfCommandParameter = getIndexOfCommandParameter(); List<String> commandToExecute = originalArgs.subList(indexOfCommandParameter + 1, originalArgs.size()); return commandToExecute; }  @Override void execute(); @Override boolean shouldShowUsage();  }
@Test public void getCommandToExecute() { retryCommandSpy.originalArgs = Arrays.asList("retry", "-d", "tmp", "-c", "ls", "-al"); assertEquals(Arrays.asList("ls", "-al"), retryCommandSpy.getCommandToExecute()); }