NumberFormatUtils { @NonNull public static NumberFormat createDefaultNumberFormat() { NumberFormat numberFormat = NumberFormat.getNumberInstance(); numberFormat.setMaximumFractionDigits(MAXIMUM_FRACTION_DIGITS); numberFormat.setMinimumFractionDigits(MINIMUM_FRACTION_DIGITS); return numberFormat; } private  NumberFormatUtils(); @NonNull static NumberFormat createDefaultNumberFormat();  }
@Test public void SetMinimumAndMaximumNumberOfDigits() { NumberFormat numberFormat = NumberFormatUtils.createDefaultNumberFormat(); assertThat(numberFormat.getMinimumFractionDigits()).isZero(); assertThat(numberFormat.getMaximumFractionDigits()).isEqualTo(3); }