store.migrateTo(newFactory);
// check new store
DataStore<StoredCredential> newStore =
newFactory.getDataStore(StoredCredential.DEFAULT_DATA_STORE_ID);
assertEquals(ImmutableSet.of(USER_ID), newStore.keySet());
StoredCredential actual = newStore.get(USER_ID);
assertEquals(expected.getAccessToken(), actual.getAccessToken());
assertEquals(expected.getRefreshToken(), actual.getRefreshToken());
assertEquals(expected.getExpirationTimeMilliseconds(), actual.getExpirationTimeMilliseconds());
}