{
System.out.println("NAME: " + attr.getName() + " & " + "VALUE: " + attr.getValue());
}
//Add a new Attribute to the attribute collection of the Node.
Attribute newAttr = new Attribute("bgcolor", "red");
attrs.set(newAttr);
assertEquals(newAttr.getName(), "bgcolor");
assertEquals(newAttr.getValue(), "red");
for (Attribute attr : attrs)
{
System.out.println("NAME: " + attr.getName() + " & " + "VALUE: " + attr.getValue());
}
//Clear (remove) an Attribute in the attribute collection of the Node.
System.out.println("\n\nRemove:");
assertEquals(true, attrs.contains(new Attribute("bgcolor", "red")));
attrs.remove(new Attribute("bgcolor", "red"));
assertNull(attrs.get("bgcolor"));
for (Attribute attr : attrs)
{
System.out.println("NAME: " + attr.getName() + " & " + "VALUE: " + attr.getValue());
}
//Clear all the attributes of the Node.
attrs.clear();
assertEquals(true, attrs.isEmpty());
//assertEquals(attrs,null);
//Add a new Atribute collection to the Node.
System.out.println("\n\nAdd:");
List<Attribute> attrList = new ArrayList<Attribute>();
attrList.add(new Attribute("caption", "New Table"));
attrList.add(1, new Attribute("border", "2"));
attrList.add(2, new Attribute("bgcolor", "blue"));
assertEquals(true, attrs.addAll(0, attrList));
for (Attribute attr : attrs)
{
System.out.println("NAME: " + attr.getName() + " & " + "VALUE: " + attr.getValue());
}
//Insert a new Attribute to the attribute collection of the Node.
attrs.add(attrs.size() - 1, new Attribute("cellspacing", "2"));
//assertEquals(attrs.get(attrs.size()-1),new Attribute("cellspacing","2"));
assertNotNull(attrs.get(attrs.size() - 1));
System.out.println("\n\nInsert:");
for (Attribute attr : attrs)
{