@Test public void testAddAllComposers() throws Exception { Collection<Responsible> toAdd = new HashSet<>(); toAdd.add(RESPONSIBLE_FACTORY.getNext()); toAdd.add(RESPONSIBLE_FACTORY.getNext()); toAdd.add(RESPONSIBLE_FACTORY.getNext()); composers.addAll(toAdd); entity.addAllComposers(toAdd); assertEquals(composers, entity.getComposers()); }
@Test public void testRemoveAllComposers() throws Exception { Responsible base = RESPONSIBLE_FACTORY.getNext(); Responsible second = RESPONSIBLE_FACTORY.getNext(); Responsible third = RESPONSIBLE_FACTORY.getNext(); Collection<Responsible> toAdd = new HashSet<>(); toAdd.add(base); toAdd.add(second); toAdd.add(third); Collection<Responsible> toRemove = new HashSet<>(); toRemove.add(second); toRemove.add(third); composers.addAll(toAdd); entity.addAllComposers(toAdd); composers.removeAll(toRemove); entity.removeAllComposers(toRemove); assertEquals(composers, entity.getComposers()); }