### Question:
ListPM extends AbstractPM implements IListPM<T> { public T removeAt(int index) { if (index < 0 || index >= entries.size()) { throw new IndexOutOfBoundsException("index=" + index); } Entry e = entries.get(index); assert (e != null); if (e.isSelected) { e.isSelected = false; selection.selectionSize--; support.fireElementsDeselected(index, 1); } onRemove(e.element); entries.remove(index); support.fireElementsRemoved(index, e.element); return e.element; } ListPM();  ListPM(int initialCapacity);  ListPM(ArrayList<Entry> list); protected  ListPM(List<Entry> list); Sorter getSorter(); void setSorter(Sorter sorter); boolean isRevalidateElementsOnChangeEnabled(); void setRevalidateElementsOnChangeEnabled(boolean enabled); void addListListener(ListListener l); void removeListListener(ListListener l); void revalidateElements(); void replace(T oldElement, T newElement); void replace(int index, T newElement); void add(T element); void add(int index, T element); void addAll(Collection<T> col); boolean contains(T element); boolean containsAll(Collection<T> col); void clear(); boolean removeAll(Collection<? extends T> col); boolean remove(T element); T removeAt(int index); void swap(int indexA, int indexB); void swap(T elemA, T elemB); void reverse(); void sortBy(boolean ascending, Path... paths); void sortBy(Collection<SortKey> newSortKeys); void sortBy(SortKey... newSortKeys); Collection<SortKey> getSortKeys(); T getAt(int index); Collection<T> toCollection(); Object[] toArray(); Selection<T> getSelection(); int indexOf(T element); int[] indicesOf(Collection<? extends T> col); int size(); boolean isEmpty(); Iterator<T> iterator(); ListIterator<T> listIterator(final int index);  }### Answer:
@Test public void removeAt() { int sizeBefore = list.size(); DummyPM pModel = list.getAt(4); assertEquals("list.contains(pModel)", true, list.contains(pModel)); list.getSelection().add(pModel); assertEquals("counter.elementsSelected", 1, counter.elementsSelected); assertEquals("counter.elementsDeselected", 0, counter.elementsDeselected); list.removeAt(4); assertEquals("list.size()", sizeBefore - 1, list.size()); assertEquals("counter.elementsRemoved", 1, counter.elementsRemoved); assertEquals("counter.elementsSelected", 1, counter.elementsSelected); assertEquals("counter.elementsDeselected", 1, counter.elementsDeselected); assertEquals("list.contains(pModel)", false, list.contains(pModel)); assertEquals("list.getSelection().getMaxIndex()", -1, list.getSelection().getMaxIndex()); assertEquals("list.getSelection().getMinIndex()", -1, list.getSelection().getMinIndex()); }