Collection extends GenericXMLEncodable implements XMLEncodable, Iterable<Link>, Cloneable { public LinkedList<Link> contents() { return _contents; } Collection();  Collection(java.util.Collection<Link> contents);  Collection(Link [] contents);  Collection(ArrayList<ContentName> nameContents);  Collection(String label, ArrayList<ContentName> nameContents); @SuppressWarnings("unchecked") Collection clone(); LinkedList<Link> contents(); Link get(int i); Link get(String label); void add(Link content); void add(ArrayList<Link> contents); void add(String label, ArrayList<ContentName> nameContents); void add(String label, ContentName target); Link remove(int i); boolean remove(Link content); void removeAll(); int size(); ArrayList<Link> find(Link target); ArrayList<Link> find(ContentName targetName); ArrayList<Link> find(String targetLabel); @Override void decode(XMLDecoder decoder); @Override void encode(XMLEncoder encoder); @Override boolean validate(); @Override long getElementLabel(); @Override int hashCode(); @Override boolean equals(Object obj); String toString(); Iterator<Link> iterator();  }
@Test public void testContents() { Log.info(Log.FAC_TEST, "Starting testContents"); Collection cd = new Collection(); Assert.assertTrue(cd.validate()); for (int i=0; i < lrs.length; ++i) { cd.add(lrs[i]); } LinkedList<Link> c = cd.contents(); Assert.assertNotNull(c); Assert.assertTrue(c.size() == lrs.length); for (int i=0; i < lrs.length; ++i) { Assert.assertEquals(c.get(i), lrs[i]); } int j=0; for (Link l : cd) { Assert.assertEquals(l, lrs[j++]); } Log.info(Log.FAC_TEST, "Completed testContents"); }