### Question:
LocaleFormatter { @Nonnull public static String getFormattedPercent (final double dValue, @Nonnull final Locale aDisplayLocale) { ValueEnforcer.notNull (aDisplayLocale, "DisplayLocale"); return NumberFormat.getPercentInstance (aDisplayLocale).format (dValue); } private  LocaleFormatter(); @Nonnull static String getFormatted(final double dValue, @Nonnull final Locale aDisplayLocale); @Nonnull static String getFormatted(final int nValue, @Nonnull final Locale aDisplayLocale); @Nonnull static String getFormatted(final long nValue, @Nonnull final Locale aDisplayLocale); @Nonnull static String getFormatted(@Nonnull final BigInteger aValue, @Nonnull final Locale aDisplayLocale); @Nonnull static String getFormatted(@Nonnull final BigDecimal aValue, @Nonnull final Locale aDisplayLocale); @Nonnull static String getFormatted(@Nonnull final BigDecimal aValue,
                                     @Nonnegative final int nFractionDigits,
                                     @Nonnull final Locale aDisplayLocale); @Nonnull static String getFormattedWithAllFractionDigits(@Nonnull final BigDecimal aValue, @Nonnull final Locale aDisplayLocale); @Nonnull static String getFormattedPercent(final double dValue, @Nonnull final Locale aDisplayLocale); @Nonnull static String getFormattedPercent(final double dValue,
                                            @Nonnegative final int nFractionDigits,
                                            @Nonnull final Locale aDisplayLocale);  }### Answer:
@Test public void testGetFormattedPercent () { if (EJavaVersion.JDK_9.isSupportedVersion ()) { assertEquals ("12\u00A0%", LocaleFormatter.getFormattedPercent (0.123, L_DE)); assertEquals ("12\u00A0%", LocaleFormatter.getFormattedPercent (0.123, L_DE_AT)); assertEquals ("12\u00A0%", LocaleFormatter.getFormattedPercent (0.123, L_FR_FR)); } else { assertEquals ("12%", LocaleFormatter.getFormattedPercent (0.123, L_DE)); assertEquals ("12%", LocaleFormatter.getFormattedPercent (0.123, L_DE_AT)); assertEquals ("12 %", LocaleFormatter.getFormattedPercent (0.123, L_FR_FR)); } assertEquals ("12%", LocaleFormatter.getFormattedPercent (0.123, L_EN)); assertEquals ("12%", LocaleFormatter.getFormattedPercent (0.123, L_EN_US)); }
@Test public void testGetFormattedPercent_Scale () { if (EJavaVersion.JDK_9.isSupportedVersion ()) { assertEquals ("12,3\u00A0%", LocaleFormatter.getFormattedPercent (0.123, 1, L_DE)); assertEquals ("12,3\u00A0%", LocaleFormatter.getFormattedPercent (0.123, 1, L_DE_AT)); assertEquals ("12,3\u00A0%", LocaleFormatter.getFormattedPercent (0.123, 1, L_FR_FR)); } else { assertEquals ("12,3%", LocaleFormatter.getFormattedPercent (0.123, 1, L_DE)); assertEquals ("12,3%", LocaleFormatter.getFormattedPercent (0.123, 1, L_DE_AT)); assertEquals ("12,3 %", LocaleFormatter.getFormattedPercent (0.123, 1, L_FR_FR)); } assertEquals ("12.3%", LocaleFormatter.getFormattedPercent (0.123, 1, L_EN)); assertEquals ("12.3%", LocaleFormatter.getFormattedPercent (0.123, 1, L_EN_US)); }