### Question:
JPAList implements List<E> { @Override public boolean removeAll(Collection<?> c) { boolean allRemoved = true; for (Object e : c) { allRemoved = remove(e) && allRemoved; } return allRemoved; } JPAList(List<E> internalList, A associatedEntity);  JPAList(A associatedEntity);  JPAList(int initialCapacity, A associatedEntity); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Iterator<E> iterator(); @Override Object[] toArray(); @Override T[] toArray(T[] a); @Override boolean add(E e); @Override boolean remove(Object o); @Override boolean containsAll(Collection<?> c); @Override boolean addAll(Collection<? extends E> c); @Override boolean addAll(int index, Collection<? extends E> c); @Override boolean removeAll(Collection<?> c); @Override boolean retainAll(Collection<?> c); @Override void clear(); @Override E get(int index); @Override E set(int index, E element); @Override void add(int index, E element); @Override E remove(int index); @Override int indexOf(Object o); @Override int lastIndexOf(Object o); @Override ListIterator<E> listIterator(); @Override ListIterator<E> listIterator(int index); @Override List<E> subList(int fromIndex, int toIndex); void set(List<E> newList); List<E> getInternalList(); abstract void add(E entity, A associatedEntity); abstract void remove(E entity, A associatedEntity);  }### Answer:
@Test public void testRemoveAll() { final List<String> oldList = new ArrayList<String>(); final List<String> newList = new ArrayList<String>(); final List<String> resultList = new ArrayList<String>(); final int nrOfEntries = 4; oldList.add("old1"); oldList.add("both"); oldList.add("new1"); oldList.add("new2"); newList.add("new1"); newList.add("new1"); newList.add("new2"); resultList.addAll(oldList); resultList.removeAll(newList); testee.getInternalList().addAll(oldList); assertThat(testee.size()).isEqualTo(nrOfEntries); boolean result = testee.removeAll(newList); assertThat(result).isFalse(); verify(testee, times(0)).add(any(String.class), any(Long.class)); verify(testee, times(2)).remove("new1"); verify(testee, times(1)).remove("new2"); assertThat(testee.size()).isEqualTo(2); assertThat(testee.getInternalList()).isEqualTo(resultList); }