class Shell {

    static final Logger log = getLogger(lookup().lookupClass());

    private Shell() {
        throw new IllegalStateException("Utility class");
    }

    public static String runAndWait(String... command) {
        return runAndWait(true, command);
    }

    public static String runAndWait(File folder, String... command) {
        return runAndWaitArray(true, folder, command);
    }

    public static String runAndWait(boolean logCommand, String... command) {
        return runAndWaitArray(logCommand, new File("."), command);
    }

    public static String runAndWait(boolean logCommand, File folder,
            String... command) {
        return runAndWaitArray(logCommand, folder, command);
    }

    public static String runAndWaitArray(boolean logCommand, File folder,
            String[] command) {<FILL_FUNCTION_BODY>}

    public static String runAndWaitNoLog(File folder, String... command) {
        String output = "";
        try {
            Process process = new ProcessBuilder(command).directory(folder)
                    .redirectErrorStream(false).start();
            process.waitFor();
            output = IOUtils.toString(process.getInputStream(), UTF_8);
        } catch (Exception e) {
            if (log.isDebugEnabled()) {
                log.debug(
                        "There was a problem executing command <{}> on the shell: {}",
                        join(" ", command), e.getMessage());
            }
        }
        return output.trim();
    }

}

        String commandStr = Arrays.toString(command);
        if (logCommand) {
            log.debug("Running command on the shell: {}", commandStr);
        }
        String result = runAndWaitNoLog(folder, command);
        if (logCommand) {
            log.debug("Result: {}", result);
        }
        return result;
    
<no_super_class>