@Test
public void onSubscribe() {

    BehaviorProcessor<Object> p = BehaviorProcessor.create();
    BooleanSubscription bs = new BooleanSubscription();
    p.onSubscribe(bs);
    assertFalse(bs.isCancelled());
    p.onComplete();
    bs = new BooleanSubscription();
    p.onSubscribe(bs);
    assertTrue(bs.isCancelled());
}