@Test
public void testToLanguageTag() throws Exception {

    assertEquals("en-US", LogManagerProperties.toLanguageTag(Locale.US));
    assertEquals("en", LogManagerProperties.toLanguageTag(Locale.ENGLISH));
    assertEquals("", LogManagerProperties.toLanguageTag(new Locale("", "", "")));
    Locale l = new Locale("en", "US", "slang");
    assertEquals("en-US-slang", LogManagerProperties.toLanguageTag(l));
    l = new Locale("en", "", "slang");
    assertEquals("en--slang", LogManagerProperties.toLanguageTag(l));
    try {
        LogManagerProperties.toLanguageTag(null);
        fail("Null was allowed.");
    } catch (NullPointerException expect) {
    }
}