List<String> secondLevel2 = new LinkedList<String>();
secondLevel2.add("hi");
secondLevel2.add("you");
topLevel.add(secondLevel2);
FlatteningIterator iter = new FlatteningIterator(topLevel, "b");
assertEquals("a", iter.next());
assertEquals(new Integer(10), iter.next());
assertEquals("hi", iter.next());
assertEquals("you", iter.next());
assertEquals("b", iter.next());
assertFalse(iter.hasNext());
iter.next(); // should throw a NoSuchElementException
}