protected final void registerSubCommand(ICommandHandler newHandler) {
List<String> newCommands = Arrays.asList(newHandler.getNames());
for(ICommandHandler handler:subCommands) {
for(String command:handler.getNames()) {
if(newCommands.contains(command)) {
throw new DublicatedCommandException();
}
}
}
subCommands.add(newHandler);
}