Esempio n. 1
0
  @Test
  public void testRemoveAllScenarists() 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);

    scenarists.addAll(toAdd);
    entity.addAllScenarists(toAdd);

    scenarists.removeAll(toRemove);
    entity.removeAllScenarists(toRemove);

    assertEquals(scenarists, entity.getScenarists());
  }