SimpleParameter extends Parameter { static String buildFormatString(FormatOptions options, FormatChar formatChar) { char c = formatChar.getChar(); c = options.shouldUpperCase() ? (char) (c & ~0x20) : c; return options.appendPrintfOptions(new StringBuilder("%")).append(c).toString(); } private  SimpleParameter(int index, FormatChar formatChar, FormatOptions options); static SimpleParameter of(int index, FormatChar formatChar, FormatOptions options); @Override String getFormat();  }
@Test public void testPrintfFormatString() { assertThat(SimpleParameter.buildFormatString(parseOptions("-20", false), STRING)) .isEqualTo("%-20s"); assertThat(SimpleParameter.buildFormatString(parseOptions("0#16", true), HEX)) .isEqualTo("%#016X"); assertThat(SimpleParameter.buildFormatString(parseOptions("+-20", false), DECIMAL)) .isEqualTo("%+-20d"); assertThat(SimpleParameter.buildFormatString(parseOptions(",020.10", false), FLOAT)) .isEqualTo("%,020.10f"); }