static Future<Optional<String>> newUpdateChecker(
      GlobalConfig globalConfig, Verbosity verbosity, Consumer<LogEvent> log) {
    if (!verbosity.atLeast(Verbosity.info) || globalConfig.isDisableUpdateCheck()) {
      return Futures.immediateFuture(Optional.empty());
    }
    ExecutorService executorService = Executors.newSingleThreadExecutor();
    try {
      return UpdateChecker.checkForUpdate(
          executorService, VERSION_URL, VersionInfo.TOOL_NAME, VersionInfo.getVersionSimple(), log);
    } finally {
      executorService.shutdown();
    }
  }
@Test
  public void testNewUpdateChecker_noUpdateCheck() throws ExecutionException, InterruptedException {
    when(globalConfig.isDisableUpdateCheck()).thenReturn(true);
    Future<Optional<String>> updateChecker =
        JibCli.newUpdateChecker(globalConfig, Verbosity.info, ignored -> {});
    assertThat(updateChecker.get()).isEmpty();
  }