CompositeAppStateListener implements AppStateListener { @Override public void onAppDidEnterForeground() { for (AppStateListener listener : listeners) { listener.onAppDidEnterForeground(); } }  @Override void onAppDidEnterForeground(); @Override void onAppDidEnterBackground();  }
@Test public void notifiesListenersOfForeground() { compositeListener.onAppDidEnterForeground(); verify(listener1).onAppDidEnterForeground(); verify(listener2).onAppDidEnterForeground(); verify(listener3).onAppDidEnterForeground(); }