Literals { public static String normalizeLanguageTag(String languageTag) throws IllformedLocaleException { return new Locale.Builder().setLanguageTag(languageTag).build().toLanguageTag().intern(); } protected  Literals(); static String getLabel(Literal l, String fallback); static String getLabel(Value v, String fallback); static String getLabel(Optional v, String fallback); static byte getByteValue(Literal l, byte fallback); static byte getByteValue(Value v, byte fallback); static short getShortValue(Literal l, short fallback); static short getShortValue(Value v, short fallback); static int getIntValue(Literal l, int fallback); static int getIntValue(Value v, int fallback); static long getLongValue(Literal l, long fallback); static long getLongValue(Value v, long fallback); static BigInteger getIntegerValue(Literal l, BigInteger fallback); static BigInteger getIntegerValue(Value v, BigInteger fallback); static BigDecimal getDecimalValue(Literal l, BigDecimal fallback); static BigDecimal getDecimalValue(Value v, BigDecimal fallback); static float getFloatValue(Literal l, float fallback); static float getFloatValue(Value v, float fallback); static double getDoubleValue(Literal l, double fallback); static double getDoubleValue(Value v, double fallback); static boolean getBooleanValue(Literal l, boolean fallback); static boolean getBooleanValue(Value v, boolean fallback); static XMLGregorianCalendar getCalendarValue(Literal l, XMLGregorianCalendar fallback); static Duration getDurationValue(Literal l, Duration fallback); static XMLGregorianCalendar getCalendarValue(Value v, XMLGregorianCalendar fallback); static Literal createLiteral(ValueFactory valueFactory, Object object); static Literal createLiteralOrFail(ValueFactory valueFactory, Object object); static boolean canCreateLiteral(Object object); static boolean isLanguageLiteral(Literal literal); static String normalizeLanguageTag(String languageTag); static boolean isValidLanguageTag(String languageTag); static boolean langMatches(String langTag, String langRange);  }
@Test public void testNormaliseBCP47Tag() throws Exception { assertEquals("en", Literals.normalizeLanguageTag("en")); assertEquals("en-AU", Literals.normalizeLanguageTag("en-AU")); assertEquals("en-AU", Literals.normalizeLanguageTag("en-au")); assertEquals("en-AU", Literals.normalizeLanguageTag("EN-AU")); assertEquals("en-AU", Literals.normalizeLanguageTag("EN-au")); assertEquals("fr-FR", Literals.normalizeLanguageTag("fr-FR")); assertEquals("fr-FR", Literals.normalizeLanguageTag("fr-fr")); assertEquals("fr-FR", Literals.normalizeLanguageTag("FR-FR")); assertEquals("fr-FR", Literals.normalizeLanguageTag("FR-fr")); }