Subtag implements Serializable, Cloneable,
		Comparable<Subtag> { @SuppressWarnings("unchecked") public <T extends Enum<?>> T getEnum() { switch (type) { case PRIMARY: return (T) Language.valueOf(this); case SCRIPT: return (T) Script.valueOf(this); case REGION: return (T) Region.valueOf(this); case VARIANT: return (T) Variant.valueOf(this); case EXTLANG: return (T) Extlang.valueOf(this); case SINGLETON: return (T) Singleton.valueOf(this); default: return null; } } Subtag(Language language);  Subtag(Script script);  Subtag(Region region);  Subtag(Variant variant);  Subtag(Extlang extlang);  Subtag(Singleton singleton);  Subtag(Type type, String name);   Subtag();  Subtag(Type type, String name, Subtag prev);   Subtag(Type type, String name, Subtag prev, Subtag next); Type getType(); String getName(); Subtag getPrevious(); Subtag getNext(); String toString(); int hashCode(); boolean equals(Object obj); Subtag clone(); boolean isDeprecated(); @SuppressWarnings("unchecked") T getEnum(); boolean isValid(); Subtag canonicalize(); static Subtag newWildcard(); int compareTo(Subtag o);  }
@Test public void testGetEnum() { assertNull(new Subtag().getEnum()); }