public static Command newInstance(Command parentCommand, CommandType type, String name) {
    String className = MessageFormat.format(CLASS_NAME_PATTERN, type, StringUtil.toUpperCaseFirst(name));
    try {
      return (Command) Class.forName(className).newInstance();
    } catch (InstantiationException e) {
      throw new CommandInitiateException(type, name, className);
    } catch (IllegalAccessException e) {
      throw new CommandInitiateException(type, name, className);
    } catch (ClassNotFoundException e) {
      if (name.equals(DEFAULT_CLASS_NAME)) {
        throw new NotImplementedCommandException(parentCommand, type, name, className);
      }
      return newInstance(parentCommand, type, DEFAULT_CLASS_NAME);
    }
  }