SubtagSet implements Serializable, Cloneable, Iterable<Subtag>,
		Comparable<SubtagSet> { public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final SubtagSet other = (SubtagSet) obj; if (count() != other.count()) { return false; } Iterator<Subtag> i1 = iterator(); Iterator<Subtag> i2 = other.iterator(); while (i1.hasNext()) { Subtag subtag1 = i1.next(); Subtag subtag2 = i2.next(); if (!subtag1.toString().equals(subtag2.toString())) { return false; } } return true; } protected  SubtagSet(Subtag primary); String toString(); Iterator<Subtag> iterator(); boolean contains(Subtag subtag); boolean contains(String tag); boolean contains(String tag, Subtag.Type type); int length(); boolean isValid(); @SuppressWarnings("unused") int count(); Subtag get(int index); int hashCode(); boolean equals(Object obj); Subtag[] toArray(); List<Subtag> asList(); int compareTo(SubtagSet o);  }
@Test public void testEqualsObject() { Subtag lang1 = new Subtag(Language.EN); Subtag region1 = new Subtag(Region.US); lang1.setNext(region1); ConcreteSubtagSet set1 = new ConcreteSubtagSet(lang1); Subtag lang2 = new Subtag(Language.EN); Subtag region2 = new Subtag(Region.US); lang2.setNext(region2); ConcreteSubtagSet set2 = new ConcreteSubtagSet(lang2); Subtag lang3 = new Subtag(Language.DE); Subtag region3 = new Subtag(Region.DE); lang3.setNext(region3); ConcreteSubtagSet set3 = new ConcreteSubtagSet(lang3); Subtag lang4 = new Subtag(Language.EN); Subtag region4 = new Subtag(Region.US); Subtag script4 = new Subtag(Script.LATN); lang4.setNext(region4); region4.setNext(script4); ConcreteSubtagSet set4 = new ConcreteSubtagSet(lang4); assertEquals(set1, set1); assertEquals(set1, set2); assertFalse(set1.equals(set3)); assertFalse(set1.equals(set4)); assertFalse(set1.equals(null)); assertFalse(set1.equals(new Object())); }