### Question:
ArrayIndexedCollection extends Collection { @Override public boolean remove(Object value) { int index = indexOf(value); if (index == VALUE_NOT_FOUND_RETURN_VALUE) { return false; } remove(index); return true; } ArrayIndexedCollection();  ArrayIndexedCollection(int initialCapacity);  ArrayIndexedCollection(Collection collection);  ArrayIndexedCollection(Collection collection, int capacity); @Override int size(); @Override boolean contains(Object value); @Override boolean remove(Object value); @Override Object[] toArray(); @Override void forEach(Processor processor); @Override void add(Object value); Object get(int index); @Override void clear(); void insert(Object value, int position); int indexOf(Object value); void remove(int index); @Override String toString(); static final int VALUE_NOT_FOUND_RETURN_VALUE; }### Answer:
@Test void testRemoveWithNegativeIndex() { assertThrows(IndexOutOfBoundsException.class, () -> createCollectionWithNElements(5).remove(-1)); }
@Test void testRemoveWithSizeAsIndex() { assertThrows(IndexOutOfBoundsException.class, () -> createCollectionWithNElements(5).remove(6)); }
@Test void testRemoveIndexWithEmptyCollection() { assertThrows(IndexOutOfBoundsException.class, () -> createCollectionWithNElements(0).remove(0)); }
@Test void testRemoveWithEmptyCollection() { assertFalse(createCollectionWithNElements(0).remove(new Object())); }
@Test void testRemoveWithNull() { assertFalse(createCollectionWithNElements(5).remove(null)); }
@Test void testRemoveWithNonExistingValue() { assertFalse(createCollectionWithNElements(5).remove("stefica")); }