@Test
@SuppressLint("CommitPrefEdits")
public void keyIsStoredInPreference(){

    SharedPreferences pref = mock(SharedPreferences.class);
    SharedPreferences.Editor editor = mock(SharedPreferences.Editor.class);
    when(pref.edit()).thenReturn(editor);
    when(editor.putString(anyString(),anyString())).thenReturn(editor);
    GoogleAsrKey key = new GoogleAsrKey(FAKE_KEY);
    key.store(pref);
    verify(pref).edit();
    verify(editor).putString(anyString(),eq(FAKE_KEY));
}