public void init() {
    this.scheduledExecutorService = Executors.newSingleThreadScheduledExecutor(
        ApolloThreadFactory
            .create("DatabaseDiscoveryWithCache", true)
    );
    scheduledExecutorService.scheduleAtFixedRate(this::updateCacheTask,
        SYNC_TASK_PERIOD_IN_SECOND, SYNC_TASK_PERIOD_IN_SECOND, TimeUnit.SECONDS);

    // load them for init
    try {
      this.getInstances(ServiceNameConsts.APOLLO_CONFIGSERVICE);
    } catch (Throwable t) {
      log.error("fail to get instances of service name {}", ServiceNameConsts.APOLLO_CONFIGSERVICE, t);
    }
    try {
      this.getInstances(ServiceNameConsts.APOLLO_ADMINSERVICE);
    } catch (Throwable t) {
      log.error("fail to get instances of service name {}", ServiceNameConsts.APOLLO_ADMINSERVICE, t);
    }
  }
@Test
  void init() {
    DatabaseDiscoveryClient client = Mockito.mock(DatabaseDiscoveryClient.class);
    DatabaseDiscoveryClientMemoryCacheDecoratorImpl decorator
        = new DatabaseDiscoveryClientMemoryCacheDecoratorImpl(client);
    decorator.init();
  }