code: public final void migrateTo(DataStore<StoredCredential> credentialDataStore) throws IOException {
      DatastoreService service = DatastoreServiceFactory.getDatastoreService();
      PreparedQuery queryResult = service.prepare(new Query(KIND));
      for (Entity entity : queryResult.asIterable()) {
        StoredCredential storedCredential = new StoredCredential().setAccessToken(
            (String) entity.getProperty("accessToken"))
            .setRefreshToken((String) entity.getProperty("refreshToken"))
            .setExpirationTimeMilliseconds((Long) entity.getProperty("expirationTimeMillis"));
        credentialDataStore.set(entity.getKey().getName(), storedCredential);
      }
    }
docs: Migrates to the new format using {@link DataStore} of {@link StoredCredential}.
  
  @param credentialDataStore credential data store
  @since 1.16