### Question:
Group extends Item { @Modifies( "items" ) public void setItems(String[] items) { this.items.clear(); if (items != null) { for (String s : items) { addItem(s); } } } Group();  Group(String type);  Group(String type, String label); String getLabel(); void setLabel(String label); String[] getItems(); List<String> getItemList(); @Modifies( "items" ) void setItems(String[] items); @Modifies( "items" ) void addItem(String itemId); @Modifies( "items" ) void insertItem(String itemId, String beforeItemId); @Modifies( "items" ) void appendItem(String itemId, String afterItemId); @Modifies( "items" ) int removeItem(String itemId); @Modifies( "items" ) void setItems(Object[] items); String getItemsAsString(); @Modifies( "items" ) void setItemsAsString(String items); @Override String toString(); @Modifies( { "presentationStyles", "stylesList" } ) void addPresentationStyle(String presentationStyle); @Modifies( { "presentationStyles", "stylesList" } ) void removePresentationStyle(String presentationStyle); static final String COMMA_SEPARATOR; }### Answer:
@Test public void testSetItems() { Group group = new Group(); group.setItems(new String[] { "a", "b", null, "c" }); assertArrayEquals(new String[] { "a", "b", "c" }, group.getItems()); assertEquals("a,b,c", group.getInternalItemsAsString()); }
@Test public void testSetItemsContainingComma() { Group group = new Group(); try { group.setItems(new String[] { "a", "b,", "c" }); fail(); } catch (IllegalArgumentException e) { } }