### Question:
SummarizerUtils { public static String percent(double value) { BigDecimal dec = BigDecimal.valueOf(value); dec = dec.multiply(BigDecimal.valueOf(100)).stripTrailingZeros(); if (dec.scale() > 4) { dec = dec.setScale(4, RoundingMode.HALF_UP); } return dec.toPlainString() + "%"; } private  SummarizerUtils(); static String date(LocalDate date); static String dateRange(LocalDate start, LocalDate end); static String datePeriod(LocalDate start, LocalDate end); static String amount(CurrencyAmount currencyAmount); static String amount(Currency currency, double value); static String value(double value); static String percent(double value); static String payReceive(PayReceive payReceive); static String fx(CurrencyAmount base, CurrencyAmount counter); static PortfolioItemSummary summary(Position position, ProductType type, String description, Currency... currencies); static PortfolioItemSummary summary(Trade trade, ProductType type, String description, Currency... currencies);  }### Answer:
@Test public void test_percent() { assertThat(SummarizerUtils.percent(0.12)).isEqualTo("12%"); assertThat(SummarizerUtils.percent(0.123)).isEqualTo("12.3%"); assertThat(SummarizerUtils.percent(0.1234)).isEqualTo("12.34%"); assertThat(SummarizerUtils.percent(0.12345)).isEqualTo("12.345%"); assertThat(SummarizerUtils.percent(0.123456)).isEqualTo("12.3456%"); assertThat(SummarizerUtils.percent(0.1234564)).isEqualTo("12.3456%"); assertThat(SummarizerUtils.percent(0.1234567)).isEqualTo("12.3457%"); }