@Test
public void testClear() {

    BooleanSubscription s1 = new BooleanSubscription();
    BooleanSubscription s2 = new BooleanSubscription();
    CompositeSubscription s = new CompositeSubscription();
    s.add(s1);
    s.add(s2);
    assertFalse(s1.isUnsubscribed());
    assertFalse(s2.isUnsubscribed());
    s.clear();
    assertTrue(s1.isUnsubscribed());
    assertTrue(s1.isUnsubscribed());
    assertFalse(s.isUnsubscribed());
    BooleanSubscription s3 = new BooleanSubscription();
    s.add(s3);
    s.unsubscribe();
    assertTrue(s3.isUnsubscribed());
    assertTrue(s.isUnsubscribed());
}