### Question:
RxShell { public synchronized Single<Boolean> isAlive() { if (RXSDebug.isDebug()) Timber.tag(TAG).v("isAlive()"); if (session == null) return Single.just(false); else return session.flatMap(Session::isAlive); } RxShell(RxProcess rxProcess); synchronized Single<Session> open(); synchronized Single<Boolean> isAlive(); synchronized Completable cancel(); synchronized Single<Integer> close();  }### Answer:
@Test public void testIsAlive() { RxShell rxShell = new RxShell(rxProcess); RxShell.Session session = rxShell.open().test().awaitCount(1).assertNoErrors().values().get(0); session.isAlive().test().awaitDone(1, TimeUnit.SECONDS).assertNoErrors().assertValue(true); when(rxProcessSession.isAlive()).thenReturn(Single.just(false)); session.isAlive().test().awaitDone(1, TimeUnit.SECONDS).assertNoErrors().assertValue(false); when(rxProcessSession.isAlive()).thenReturn(Single.just(true)); session.isAlive().test().awaitDone(1, TimeUnit.SECONDS).assertNoErrors().assertValue(true); verify(rxProcessSession, times(3)).isAlive(); }