Command () { final String command = getCommand(); final List<Command> commands = getCommands(); if (commands == null || command == null) { return null; } for (final Command realCommand : commands) { if (realCommand.getName().equals(command)) { return realCommand; } } return null; }