assertTrue(list.get(0) instanceof Book);
Book b = (Book) list.get(0);
assertEquals(2, b.getAttributes().size());
assertTrue(list.get(1) instanceof Magazine);
Magazine m = (Magazine) list.get(1);
assertEquals(1, m.getAttributes().size());
assertTrue(list.get(2) instanceof Book);
b = (Book) list.get(2);
assertEquals(2, b.getAttributes().size());