@Test
public void hasObservers() {

    UnicastSubject<Integer> us = UnicastSubject.create();
    assertFalse(us.hasObservers());
    TestObserver<Integer> to = us.test();
    assertTrue(us.hasObservers());
    to.cancel();
    assertFalse(us.hasObservers());
}