class MessageFormatter {
  private static final MessageFormatter INSTANCE = new MessageFormatter();

  public static MessageFormatter instance() {
    return INSTANCE;
  }

  @VisibleForTesting
  DescriptionFormatter descriptionFormatter = DescriptionFormatter.instance();

  @VisibleForTesting
  MessageFormatter() {}

  /**
   * Interprets a printf-style format {@code String} for failed assertion messages. It is similar to
   * <code>{@link String#format(String, Object...)}</code>, except for:
   * <ol>
   * <li>the value of the given <code>{@link Description}</code> is used as the first argument referenced in the format
   * string</li>
   * <li>each of the arguments in the given array is converted to a {@code String} by invoking
   * <code>{@link org.assertj.core.presentation.Representation#toStringOf(Object)}</code>.
   * </ol>
   * 
   * @param d the description of the failed assertion, may be {@code null}.
   * @param p the Representation used
   * @param format the format string.
   * @param args arguments referenced by the format specifiers in the format string.
   * @throws NullPointerException if the format string is {@code null}.
   * @return A formatted {@code String}.
   */
  public String format(Description d, Representation p, String format, Object... args) {
    requireNonNull(format);
    requireNonNull(args);
    return descriptionFormatter.format(d) + formatIfArgs(format, format(p, args));
  }

  private Object[] format(Representation p, Object[] args) {<FILL_FUNCTION_BODY>}

  private String asText(Representation p, Object o) {
    if (o instanceof AbstractComparisonStrategy) {
      return ((AbstractComparisonStrategy) o).asText();
    }
    return p.toStringOf(o);
  }
}

    int argCount = args.length;
    String[] formatted = new String[argCount];
    for (int i = 0; i < argCount; i++) {
      formatted[i] = asText(p, args[i]);
    }
    return formatted;
  
<no_super_class>