XStream xstream = XBirdCollectionStrategy.getAnnotationProcessableXStreamInstance();
XBirdCollectionStrategy<String, Object> strategy = new XBirdCollectionStrategy<String, Object>(COLLECTION_NAME, xstream);
//xstream.processAnnotations(Author.class);
List<Author> list = new XmlArrayList(strategy);
// adds four authors
list.add(new Author("joe walnes"));
list.add(new Author("joerg schaible"));
list.add(new Author("mauro talevi"));
list.add(new Author("guilherme silveira"));
// adding an extra author
Author mistake = new Author("mama");
list.add(mistake);
Assert.assertEquals(5, list.size());
List<Author> list2 = new XmlArrayList(strategy);
Iterator<Author> itor = list2.iterator();
while(itor.hasNext()) {
Author author = itor.next();
if(author.getName().equals("mama")) {
System.out.println("Removing mama...");
itor.remove();
} else {
System.out.println("Keeping " + author.getName());
}
}
Assert.assertEquals(4, list.size());
list2.clear();
}