@Test public void testAddAllOtherStaffMembers() throws Exception { Collection<Responsible> toAdd = new HashSet<>(); toAdd.add(RESPONSIBLE_FACTORY.getNext()); toAdd.add(RESPONSIBLE_FACTORY.getNext()); toAdd.add(RESPONSIBLE_FACTORY.getNext()); otherStaffMembers.addAll(toAdd); entity.addAllOtherStaffMembers(toAdd); assertEquals(otherStaffMembers, entity.getOtherStaffMembers()); }
@Test public void testRemoveAllOtherStaffMembers() 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); otherStaffMembers.addAll(toAdd); entity.addAllOtherStaffMembers(toAdd); otherStaffMembers.removeAll(toRemove); entity.removeAllOtherStaffMembers(toRemove); assertEquals(otherStaffMembers, entity.getOtherStaffMembers()); }