RxAppStateMonitor { @NonNull public static Observable<AppState> monitor(@NonNull Application app) { return Observable.create(new AppStateObservableOnSubscribe(new DefaultAppStateRecognizer(app))); }  @NonNull static Observable<AppState> monitor(@NonNull Application app);  }
@Test public void emitsAppStates() { FakeApplication fakeApplication = new FakeApplication(); TestObserver<AppState> subscriber = TestObserver.create(); RxAppStateMonitor.monitor(fakeApplication).subscribe(subscriber); fakeApplication.goForeground(); fakeApplication.goBackground(); subscriber.assertValues(FOREGROUND, BACKGROUND); subscriber.assertNotTerminated(); }