import java.text.*;
import java.util.*;

import org.junit.*;

/**
 * Succeeds with Java 11, 12,
 * Fails with Java 13, 14, 17
 */
public final class FrNumberFormatTest
{
    /**
     * This was the number separator in Java 8, 11 and 12.
     */
    private static final String NBSP = "\u00A0";

    /**
     * This appears to be the number separator in Java 13 to 17.
     * https://en.wikipedia.org/wiki/Template:Narrow_no-break_space
     */
    private static final String NNBSP = "\u202F";

    @Test
    public void checkNumberFormat()
    {
        final String formatted = this.formatFr(1000);
        Assert.assertEquals("1 000", formatted);
    }

    @Test
    public void checkSeparator()
    {
        final String formatted = this.formatFr(1000);
        Assert.assertEquals(NBSP, formatted.substring(1, 2));
    }

    private String formatFr(int number) {
        final NumberFormat format = NumberFormat.getInstance(Locale.FRANCE);
        return format.format(number);
    }
}
