this.commands = ImmutableList.copyOf(commands);
this.commandsMap = map(this.commands);
}
private RadixTree<Command> map(List<Command> commands) {
RadixTree<Command> result = new ConcurrentRadixTree<Command>(new DefaultCharArrayNodeFactory());
for (Command command : commands) {
result.put(command.getName(), command);
}
return result;
}