code: static String format(final String messagePattern, final Object[] arguments) {
          final StringBuilder result = new StringBuilder();
          final int argCount = arguments == null ? 0 : arguments.length;
          formatMessage(result, messagePattern, arguments, argCount);
          return result.toString();
      }
docs: Replace placeholders in the given messagePattern with arguments.
  
  @param messagePattern the message pattern containing placeholders.
  @param arguments      the arguments to be used to replace placeholders.
  @return the formatted message.