Subtag implements Serializable, Cloneable,
		Comparable<Subtag> { public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final Subtag other = (Subtag) obj; if (other.getType() == Type.WILDCARD || getType() == Type.WILDCARD) return true; if (name == null) { if (other.name != null) return false; } else if (!name.equalsIgnoreCase(other.name)) return false; if (other.getType() == Type.SIMPLE || getType() == Type.SIMPLE) return true; if (type == null) { if (other.type != null) return false; } else if (!type.equals(other.type)) return false; return true; } 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 testEqualsObject() { Subtag langSubtag1 = new Subtag(Language.DE); Subtag langSubtag2 = new Subtag(Language.DE); Subtag langSubtag3 = new Subtag(Language.EN); Subtag regionSubtag = new Subtag(Region.DE); Subtag wildcardSubtag = new Subtag(); Subtag nullSubtag = new Subtag(null, null); Subtag nullTypeSubtag = new Subtag(null, "de"); Subtag simpleSubtag = new Subtag(Type.SIMPLE, "de"); assertFalse(langSubtag1.equals(null)); assertFalse(langSubtag1.equals(new Object())); assertEquals(langSubtag1, langSubtag1); assertEquals(langSubtag1, langSubtag2); assertFalse(langSubtag1.equals(langSubtag3)); assertFalse(langSubtag1.equals(regionSubtag)); assertEquals(langSubtag1, wildcardSubtag); assertFalse(nullSubtag.equals(langSubtag1)); assertFalse(nullTypeSubtag.equals(langSubtag1)); assertEquals(langSubtag1, simpleSubtag); }