GitBlameCommand extends Command { int getLineNumber(String usage) throws CommandException { try { return Integer.parseInt(usage.split(":")[1]) - 1; } catch (ArrayIndexOutOfBoundsException e) { String msg = MessageFormat.format("Can't get line number from usage: {0}", usage); logger.error(msg, e); throw new CommandException(msg, e); } }  @Override void execute(); List<GitBlameWithUsage> getGitBlameWithUsagesToProcess(List<GitBlameWithUsage> gitBlameWithUsages);  }
@Test public void getFileLine() throws Exception { GitBlameCommand gitBlameCommand = new GitBlameCommand(); assertEquals(24, gitBlameCommand.getLineNumber("file.js:25")); assertEquals(24, gitBlameCommand.getLineNumber("path/to/file.js:25")); }