IndirectList extends IndirectCollection<List<E>> implements List<E> { @Override public boolean addAll(Collection<? extends E> c) { boolean res = internalList.addAll(c); if (res) { persistChange(); } return res; } IndirectList();  IndirectList(Object owner, Field f, UnitOfWorkImpl uow, List<E> referencedList); @Override boolean add(E arg0); @Override void add(int arg0, E arg1); @Override boolean addAll(Collection<? extends E> c); @Override boolean addAll(int index, Collection<? extends E> c); @Override void clear(); @Override boolean contains(Object arg0); @Override boolean containsAll(Collection<?> arg0); @Override E get(int arg0); @Override int indexOf(Object arg0); @Override boolean isEmpty(); @Override Iterator<E> iterator(); @Override int lastIndexOf(Object arg0); @Override ListIterator<E> listIterator(); @Override ListIterator<E> listIterator(int arg0); @Override boolean remove(Object arg0); @Override E remove(int arg0); @Override boolean removeAll(Collection<?> arg0); @Override boolean retainAll(Collection<?> arg0); @Override E set(int arg0, E arg1); @Override int size(); @Override List<E> subList(int fromIndex, int toIndex); @Override Object[] toArray(); @Override T[] toArray(T[] arg0); @Override List<E> unwrap(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test void testAddAll() { final List<OWLClassA> toAdd = new ArrayList<>(); for (int i = 0; i < 5; i++) { final OWLClassA a = new OWLClassA(); a.setUri(URI.create("http: toAdd.add(a); } owner.getReferencedList().addAll(toAdd); verify(uow).attributeChanged(owner, ownerField); assertEquals(backupList.size() + toAdd.size(), target.size()); }
@Test void addAllDoesNothingWhenNoNewElementsAreAdded() { owner.getReferencedList().addAll(Collections.emptyList()); verify(uow, never()).attributeChanged(owner, ownerField); }