@Test
public void fromJSON_whenPreferencesAreInvalid_DoesNotSaveOrResetGeneralKeys() throws Exception {

    JSONObject content = new JSONObject();
    JSONObject general = new JSONObject();
    content.put("general", general);
    content.put("admin", new JSONObject());
    general.put(KEY_PASSWORD, false);
    GeneralSharedPreferences generalSharedPreferences = mock(GeneralSharedPreferences.class);
    new PreferenceSaver(generalSharedPreferences, AdminSharedPreferences.getInstance()).fromJSON(content.toString(), mock(ActionListener.class));
    verify(generalSharedPreferences, never()).save(any(), any());
    verify(generalSharedPreferences, never()).reset(any());
}