class FirebaseRemoteConfig {

  @NonNull
  public Task<Boolean> activate() {
    Task<ConfigContainer> fetchedConfigsTask = fetchedConfigsCache.get();
    Task<ConfigContainer> activatedConfigsTask = activatedConfigsCache.get();

    return Tasks.whenAllComplete(fetchedConfigsTask, activatedConfigsTask)
        .continueWithTask(
            executor,
            (unusedListOfCompletedTasks) -> {
              if (!fetchedConfigsTask.isSuccessful() || fetchedConfigsTask.getResult() == null) {
                return Tasks.forResult(false);
              }
              ConfigContainer fetchedContainer = fetchedConfigsTask.getResult();

              // If the activated configs exist, verify that the fetched configs are fresher.
              if (activatedConfigsTask.isSuccessful()) {
                @Nullable ConfigContainer activatedContainer = activatedConfigsTask.getResult();
                if (!isFetchedFresh(fetchedContainer, activatedContainer)) {
                  return Tasks.forResult(false);
                }
              }

              return activatedConfigsCache
                  .put(fetchedContainer)
                  .continueWith(executor, this::processActivatePutTask);
            });
  }

    FirebaseRemoteConfig(
      Context context,
      FirebaseApp firebaseApp,
      FirebaseInstallationsApi firebaseInstallations,
      @Nullable FirebaseABTesting firebaseAbt,
      Executor executor,
      ConfigCacheClient fetchedConfigsCache,
      ConfigCacheClient activatedConfigsCache,
      ConfigCacheClient defaultConfigsCache,
      ConfigFetchHandler fetchHandler,
      ConfigGetParameterHandler getHandler,
      ConfigMetadataClient frcMetadata);

}