  @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();
  }