@Test
public void getAllOnce_getsAfterSubscribe() {

    final Map<String, ?> testMap = Collections.singletonMap("Made up map key", 234234);
    //noinspection unchecked: Not sure why this cast is needed but it works
    when(mockSharedPreferences.getAll()).thenReturn((Map) testMap);
    final Disposable subscription = rxPreferences.getAllOnce()
            .subscribeOn(testScheduler)
            .subscribe();
    subscriptions.add(subscription);
    verifyNoMoreInteractions(mockSharedPreferences);
    advanceScheduler();
    verify(mockSharedPreferences).getAll();
    verifyNoMoreInteractions(mockSharedPreferences);
}