public boolean setCommand(Command cmd) { boolean properType = false;  if (!testCommandType(cmd)) { return false; }  if (command == null) { command = cmd; return true; } else { if (cmd.getPriority() < command.getPriority()) { command = cmd; return true; } else { command = null; return false; } }
public void setCommand(Command cmd) { command = cmd;
    public boolean setCommand(Command cmd) {        boolean properType = false;        if (!testCommandType(cmd)) {            return false;        }        if (command == null) {            command = cmd;            return true;        } else {            if (cmd.getPriority() < command.getPriority()) {                command = cmd;                return true;            } else {                command = null;                return false;            }        }    }