### Question:
ArrayListSimpleCollection implements SimpleCollection<E> { public void add(E element) { if (element == null) { throw new NullPointerException("Nulls are not permitted in this collection"); } else { list.add(element); } } ArrayListSimpleCollection();  ArrayListSimpleCollection(Collection<E> initial);  ArrayListSimpleCollection(int initialCapacity); void add(E element); E get(int index); E set(int index, E element); boolean remove(E element); @Override int size(); @Override boolean isEmpty(); @Override Iterator<E> structuralIterator(); @Override Iterator<E> iterator();  }### Answer:
@Test public void add() { final ArrayListSimpleCollection<String> collection = new ArrayListSimpleCollection<>(); assertTrue(collection.isEmpty()); collection.add("a"); assertFalse(collection.isEmpty()); assertEquals(1, collection.size()); assertEquals("a", collection.iterator().next()); assertEquals("a", collection.structuralIterator().next()); }
@Test(expected = NullPointerException.class) public void addNull() { final ArrayListSimpleCollection<String> collection = new ArrayListSimpleCollection<>(); collection.add(null); }