Subscriptions { public static Subscription create(final Action0 unsubscribe) { return BooleanSubscription.create(unsubscribe); } private  Subscriptions(); static Subscription empty(); @Experimental static Subscription unsubscribed(); static Subscription create(final Action0 unsubscribe); static Subscription from(final Future<?> f); static CompositeSubscription from(Subscription... subscriptions);  }
@Test public void testUnsubscribeOnlyOnce() { Action0 unsubscribe = mock(Action0.class); Subscription subscription = create(unsubscribe); subscription.unsubscribe(); subscription.unsubscribe(); verify(unsubscribe, times(1)).call(); }