SortedList { public boolean remove(T item) { throwIfMerging(); return remove(item, true); } SortedList(Class<T> klass, Callback<T> callback);  SortedList(Class<T> klass, Callback<T> callback, int initialCapacity); int size(); int add(T item); void addAll(T[] items, boolean mayModifyInput); void addAll(T... items); void addAll(Collection<T> items); void beginBatchedUpdates(); void endBatchedUpdates(); boolean remove(T item); T removeItemAt(int index); void updateItemAt(int index, T item); void recalculatePositionOfItemAt(int index); T get(int index); int indexOf(T item); void clear(); static final int INVALID_POSITION; }
@Test public void testRemove() { Item item = new Item(); assertFalse(remove(item)); assertEquals(0, mRemovals.size()); insert(item); assertTrue(remove(item)); assertEquals(1, mRemovals.size()); assertTrue(mRemovals.contains(new Pair(0, 1))); assertEquals(0, size()); assertFalse(remove(item)); assertEquals(1, mRemovals.size()); }