@Test
public void formatMessage() {

    assertNull(MessageUtil.formatMessage(null, (Object[]) null));
    String message = "message {0}, {1}, {2}, {3}, {4}";
    assertSame(message, MessageUtil.formatMessage(message, (Object[]) null));
    assertSame(message, MessageUtil.formatMessage(message, new Object[0]));
    assertEquals("message aa, {1}, {2}, {3}, {4}", MessageUtil.formatMessage(message, "aa"));
    assertEquals("message aa, bb, {2}, {3}, {4}", MessageUtil.formatMessage(message, "aa", "bb"));
    assertEquals("message aa, bb, cc, {3}, {4}", MessageUtil.formatMessage(message, "aa", "bb", "cc"));
    assertEquals("message aa, bb, cc, dd, {4}", MessageUtil.formatMessage(message, "aa", "bb", "cc", "dd"));
    assertEquals("message aa, bb, cc, dd, ee", MessageUtil.formatMessage(message, "aa", "bb", "cc", "dd", "ee"));
}