package io.github.plastix.forage.util;

public class RxUtilsTest {
}

@@ -37,33 +37,1165 @@
 l;%0A%0A
-public class RxUtilsTest %7B
+import org.junit.Test;%0A%0Aimport rx.Subscription;%0A%0Aimport static com.google.common.truth.Truth.assert_;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.never;%0Aimport static org.mockito.Mockito.times;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.Mockito.when;%0A%0Apublic class RxUtilsTest %7B%0A%0A    @Test%0A    public void safeUnsubscribe_handleNullSubscription() %7B%0A        try %7B%0A            RxUtils.safeUnsubscribe(null);%0A        %7D catch (Exception e) %7B%0A            assert_().fail(%22RxUtils safeUnsubscribe threw an unexpected error!%22, e);%0A        %7D%0A    %7D%0A%0A    @Test%0A    public void safeUnsubscribe_unsubscribeSubscriptionCorrectly() %7B%0A        Subscription subscription = mock(Subscription.class);%0A%0A        RxUtils.safeUnsubscribe(subscription);%0A%0A        verify(subscription, times(1)).unsubscribe();%0A    %7D%0A%0A    @Test%0A    public void safeUnsubscribe_onlyUnsubscribeActiveSubscriptions() %7B%0A        Subscription subscription = mock(Subscription.class);%0A        when(subscription.isUnsubscribed()).thenReturn(true);%0A%0A        RxUtils.safeUnsubscribe(subscription);%0A%0A        verify(subscription, never()).unsubscribe();%0A    %7D
 %0A%7D%0A

Add unit tests for RxUtils.safeUnsubscribe