@Test
public void testNewNumberFormat() throws ParseException {

    assertThatIllegalArgumentException().isThrownBy(() -> of(FRENCH, null, ",.,.,.").newNumberFormat());
    assertThatIllegalArgumentException().isThrownBy(() -> of(null, null, ",.,.,.").newNumberFormat());
    double value = 1234.5d;
    NumberFormat f1 = of(FRANCE, null, null).newNumberFormat();
    assertThat(f1.parse("1234,5")).isEqualTo(value);
    assertThat(f1.format(value)).isEqualTo("1" + getGroupingSeparator(f1) + "234,5");
    NumberFormat f2 = of(US, null, null).newNumberFormat();
    assertThat(f2.parse("1,234.5")).isEqualTo(value);
    assertThat(f2.format(value)).isEqualTo("1,234.5");
    NumberFormat f3 = of(FRANCE, null, "#0.00").newNumberFormat();
    assertThat(f3.parse("1234,50")).isEqualTo(value);
    assertThat(f3.format(value)).isEqualTo("1234,50");
    NumberFormat f4 = of(US, null, "#0.00 €").newNumberFormat();
    assertThat(f4.parse("1234.50 €")).isEqualTo(value);
    assertThat(f4.format(value)).isEqualTo("1234.50 €");
}