@Test
public void testInvalidLocales() {

    try {
        LocaleUtil.parse("");
        Assert.fail("IllegalArgumentException expected");
    } catch (final IllegalArgumentException ignored) {
        // Nothing to do.
    }
    try {
        LocaleUtil.parse("__MAC");
        Assert.fail("IllegalArgumentException expected");
    } catch (final IllegalArgumentException ignored) {
        // Nothing to do.
    }
    try {
        LocaleUtil.parse("nl_G");
        Assert.fail("IllegalArgumentException expected");
    } catch (final IllegalArgumentException ignored) {
        // Nothing to do.
    }
    try {
        LocaleUtil.parse("nl_GBR_MAC");
        Assert.fail("IllegalArgumentException expected");
    } catch (final IllegalArgumentException ignored) {
        // Nothing to do.
    }
    try {
        LocaleUtil.parse("nl_GBR_MA");
        Assert.fail("IllegalArgumentException expected");
    } catch (final IllegalArgumentException ignored) {
        // Nothing to do.
    }
    try {
        LocaleUtil.parse("ac_GB");
        Assert.fail("IllegalArgumentException expected");
    } catch (final IllegalArgumentException ignored) {
        // Nothing to do.
    }
    try {
        LocaleUtil.parse("nl_UK");
        Assert.fail("IllegalArgumentException expected");
    } catch (final IllegalArgumentException ignored) {
        // Nothing to do.
    }
}