class ProcessRunner {

    public static List<String> runCommand(File workingDirectory, String... command) throws IOException {
        ProcessBuilder pb = new ProcessBuilder(command);
        if (workingDirectory != null) {
            pb.directory(workingDirectory);
        }
        pb.redirectErrorStream(true);
        Process p = start(pb);
        List<String> outputLines = getOutputLines(p);
        waitFor(p, command, outputLines);
        return outputLines;
    }

    private  ProcessRunner();

}