"<BookBean author='Ben Laurie' title='Apache' publisher='O'Reilly'/>" +
"<BookBean author='Kent Beck' title='Test Driven Development' publisher='Addision Wesley'/>" +
"</books>" +
"</LibraryBeanWithArraySetter>";
BeanReader reader = new BeanReader();
reader.getXMLIntrospector().getConfiguration().setAttributesForPrimitives(true);
reader.getBindingConfiguration().setMapIDs(false);
reader.registerBeanClass(LibraryBeanWithArraySetter.class);
LibraryBeanWithArraySetter bean = (LibraryBeanWithArraySetter) reader.parse(new StringReader(xml));
BookBean[] books = bean.getBooks();
assertEquals("Three books read", 3, books.length);
assertEquals("Book one", new BookBean("Martin Fowler", "Refactoring", "Addision Wesley"), books[0]);
assertEquals("Book two", new BookBean("Ben Laurie", "Apache", "O'Reilly"), books[1]);