@Override
    public void killProcess(String programName) throws IOException, InterruptedException,
            ProcessKillerException {
        logger.trace("Attempt to kill " + programName);
        int attempts = 0;

        if (!isProgramRunning(programName))
            return;

        for (attempts = 0; attempts < HOW_MANY_ATTEMPTS_BEFORE_FAIL; attempts++) {
            if (!askToDieGracefully(programName)) {
                killAllResistants(programName);
                return;
            }

            if (!isProgramRunning(programName)) {
                logger.detailedTrace("Successfully killed all instances of " + programName);
                return;
            }

            sleep(SECONDS.toMillis(HOW_MANY_SECONDS_BETWEEN_ATTEMPTS));
        }

        logger.error("Failed to kill " + programName + " (exception thrown)");
        throw new ProcessKillerException("Couldn't kill process - " + HOW_MANY_ATTEMPTS_BEFORE_FAIL
                + " attempts failed");
    }