### Question:
ExecutableDifferenceReporter implements Reporter { static List<String> buildCommandline(String... cmdParts) { List<String> cmd = new ArrayList<String>(); String[] cmdFromUser = cmdParts[0].split("\\s+"); Collections.addAll(cmd, cmdFromUser); cmd.addAll(Arrays.asList(cmdParts).subList(1, cmdParts.length)); return cmd; } ExecutableDifferenceReporter(String approvalCommand, String diffCommand, @Nullable String executable); @Override void notTheSame(byte[] oldValue, File fileForVerification, byte[] newValue, File fileForApproval); @Override void approveNew(byte[] value, File approvalDestination, File fileForVerification); @Override boolean canApprove(File fileForApproval); static Process runProcess(String... cmdParts);  }### Answer:
@Test public void shouldBuildTheCommandLineProperlyIfInitialCommandsHaveArguments() throws Exception { List<String> cmd = ExecutableDifferenceReporter.buildCommandline(GVIM_EXECUTABLE, "test"); assertThat(cmd.size(), CoreMatchers.equalTo(3)); assertThat(cmd.get(1), CoreMatchers.equalTo("-f")); }