@Test
public void getAllOnce_emitsMapFromInternalPreferences() {

    final Map<String, ?> testMap = Collections.singletonMap("Made up map key", 23498);
    //noinspection unchecked: Not sure why this cast is needed but it works
    when(mockSharedPreferences.getAll()).thenReturn((Map) testMap);
    final TestObserver<Map<String, ?>> subscription = rxPreferences.getAllOnce()
            .test();
    subscriptions.add(subscription);
    subscription
            .assertComplete()
            .assertValueCount(1)
            .assertValue(testMap);
}