@Test
public void testUnsubscribeOnlyOnce() {

    Runnable dispose = mock(Runnable.class);
    Disposable subscription = Disposables.fromRunnable(dispose);
    subscription.dispose();
    subscription.dispose();
    verify(dispose, times(1)).run();
}