@Test @SuppressWarnings("CheckReturnValue") public void shouldObserveConnectivity() {

  // given
  final NetworkObservingStrategy strategy = new PreLollipopNetworkObservingStrategy();
  final Context context = RuntimeEnvironment.application.getApplicationContext();
  // when
  strategy.observeNetworkConnectivity(context).subscribe(new Consumer<Connectivity>() {
    @Override public void accept(Connectivity connectivity) throws Exception {
      // then
      assertThat(connectivity.state()).isEqualTo(NetworkInfo.State.CONNECTED);
    }
  });
}