### Question:
Listeners implements Iterable<T> { @Deprecated public void add( T listener ) { requireNonNull( listener, "added listener can't be null" ); listeners.add( listener ); } @Deprecated  Listeners(); @Deprecated  Listeners( Listeners<T> other ); @Deprecated void add( T listener ); @Deprecated void remove( T listener ); @Deprecated void notify( Notification<T> notification ); @Deprecated void notify( Executor executor, Notification<T> notification ); @Override Iterator<T> iterator();  }### Answer:
@Test void addNull() { assertThrows( NullPointerException.class, () -> new Listeners<>().add( null ) ); }
@Test void add() { Listener[] listenersArray = {new Listener(), new Listener(), new Listener()}; Listeners<Listener> listeners = newListeners( listenersArray ); assertArrayEquals( listenersArray, Iterables.asArray( Listener.class, listeners ) ); }