@Test
public void asAction() {

    Preference<String> preference = rxPreferences.getString("key1", "defValue");
    Action1<? super String> action = preference.asAction();
    action.call("value1");
    assertThat(preferences.getString("key1", null)).isEqualTo("value1");
    action.call("value2");
    assertThat(preferences.getString("key1", null)).isEqualTo("value2");
}