RetryCommand extends Command { int getIndexOfCommandParameter() { int indexOf = originalArgs.indexOf(COMMAND_SHORT); if (indexOf == -1) { indexOf = originalArgs.indexOf(COMMAND_LONG); } return indexOf; }  @Override void execute(); @Override boolean shouldShowUsage();  }
@Test public void getIndexOfCommandParameter() { retryCommandSpy.originalArgs = Arrays.asList("retry", "-d", "tmp", "--command"); assertEquals(3, retryCommandSpy.getIndexOfCommandParameter()); }