### Question:
Formats { public static String format(String format, Object... args) { return format(format, Locale.getDefault(), args); } private  Formats(); static String simpleDateFormat(Date date, String pattern); static String format(String format, Object... args); @SuppressWarnings("resource") static String format(String format, Locale locale, Object... args);  }### Answer:
@Test public void format日付テスト() { String format = "%4$2s %3$2s %2$2s %1$2s"; String expected = " d c b a"; String actual = Formats.format(format, "a", "b", "c", "d"); assertEquals(expected, actual); }
@Test public void format浮動小数値テスト() { String format = "%,9.3f"; String expected = "6,217.580"; String actual = Formats.format(format, 6217.58f); assertEquals(expected, actual); }