@Test
public void asObservable() {

    Preference<String> preference = rxPreferences.getString("key1", "defValue");
    TestSubscriber<String> o = new TestSubscriber<>();
    Subscription subscription = preference.asObservable().subscribe(o);
    o.assertValues("defValue");
    rxPreferences.putString("key1", "value1");
    o.assertValues("defValue", "value1");
    rxPreferences.remove("key1");
    o.assertValues("defValue", "value1", "defValue");
    subscription.unsubscribe();
    rxPreferences.putString("key1", "foo");
    o.assertValues("defValue", "value1", "defValue");
}