### Question:
MonetaryFormat { public MonetaryFormat repeatOptionalDecimals(int decimals, int repetitions) { checkArgument(repetitions >= 0); List<Integer> decimalGroups = new ArrayList<Integer>(repetitions); for (int i = 0; i < repetitions; i++) decimalGroups.add(decimals); return new MonetaryFormat(negativeSign, positiveSign, zeroDigit, decimalMark, minDecimals, decimalGroups, shift, roundingMode, codes, codeSeparator, codePrefixed); } MonetaryFormat(); private  MonetaryFormat(char negativeSign, char positiveSign, char zeroDigit, char decimalMark, int minDecimals,
            List<Integer> decimalGroups, int shift, RoundingMode roundingMode, Map<Integer, String> codes,
            char codeSeparator, boolean codePrefixed); MonetaryFormat negativeSign(char negativeSign); MonetaryFormat positiveSign(char positiveSign); MonetaryFormat digits(char zeroDigit); MonetaryFormat decimalMark(char decimalMark); MonetaryFormat minDecimals(int minDecimals); MonetaryFormat optionalDecimals(int... groups); MonetaryFormat repeatOptionalDecimals(int decimals, int repetitions); MonetaryFormat shift(int shift); MonetaryFormat roundingMode(RoundingMode roundingMode); MonetaryFormat noCode(); MonetaryFormat code(int codeShift, String code); MonetaryFormat codeSeparator(char codeSeparator); MonetaryFormat prefixCode(); MonetaryFormat postfixCode(); MonetaryFormat withLocale(Locale locale); CharSequence format(Monetary monetary); Coin parse(String str); Fiat parseFiat(String currencyCode, String str); ShapeShiftMonetary parseShapeShiftCoin(String amount, int smallestUnitExponent); String code(); static final MonetaryFormat PPC; static final MonetaryFormat MPPC; static final MonetaryFormat UPPC; static final MonetaryFormat FIAT; static final String CODE_PPC; static final String CODE_MPPC; static final String CODE_UPPC; }### Answer:
@Test public void repeatOptionalDecimals() { assertEquals("0.000001", formatRepeat(SATOSHI, 2, 3)); assertEquals("0.000010", formatRepeat(SATOSHI.multiply(10), 2, 3)); assertEquals("0.01", formatRepeat(CENT, 2, 3)); assertEquals("0.10", formatRepeat(CENT.multiply(10), 2, 3)); assertEquals("0", formatRepeat(SATOSHI, 2, 2)); assertEquals("0", formatRepeat(SATOSHI.multiply(10), 2, 2)); assertEquals("0.01", formatRepeat(CENT, 2, 2)); assertEquals("0.10", formatRepeat(CENT.multiply(10), 2, 2)); assertEquals("0", formatRepeat(CENT, 2, 0)); assertEquals("0", formatRepeat(CENT.multiply(10), 2, 0)); }