SubtagSet implements Serializable, Cloneable, Iterable<Subtag>,
		Comparable<SubtagSet> { public Iterator<Subtag> iterator() { return new SubtagIterator(primary); } 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 testIterator() { Subtag lang = new Subtag(Language.DE); Subtag region = new Subtag(Region.DE); lang.setNext(region); ConcreteSubtagSet set = new ConcreteSubtagSet(lang); Iterator<Subtag> i = set.iterator(); try { i.remove(); fail("Expected exception"); } catch (Exception e) { } assertTrue(i.hasNext()); assertEquals(lang, i.next()); assertTrue(i.hasNext()); assertEquals(region, i.next()); assertFalse(i.hasNext()); }