static void finishUpdateChecker(
      ProjectProperties projectProperties, Future<Optional<String>> updateCheckFuture) {
    UpdateChecker.finishUpdateCheck(updateCheckFuture)
        .ifPresent(
            latestVersion -> {
              String changelogUrl =
                  ProjectInfo.GITHUB_URL + "/blob/master/jib-gradle-plugin/CHANGELOG.md";
              String privacyUrl = ProjectInfo.GITHUB_URL + "/blob/master/docs/privacy.md";
              String message =
                  String.format(
                      "\n\u001B[33mA new version of %s (%s) is available (currently using %s). Update your"
                          + " build configuration to use the latest features and fixes!\n%s\u001B[0m\n\nPlease see"
                          + " %s for info on disabling this update check.\n",
                      projectProperties.getToolName(),
                      latestVersion,
                      projectProperties.getToolVersion(),
                      changelogUrl,
                      privacyUrl);
              projectProperties.log(LogEvent.lifecycle(message));
            });
  }
@Test
  public void testFinishUpdateChecker_correctMessageLogged() {
    when(mockProjectProperties.getToolName()).thenReturn("tool-name");
    when(mockProjectProperties.getToolVersion()).thenReturn("2.0.0");
    Future<Optional<String>> updateCheckFuture = Futures.immediateFuture(Optional.of("2.1.0"));
    TaskCommon.finishUpdateChecker(mockProjectProperties, updateCheckFuture);

    verify(mockProjectProperties)
        .log(
            LogEvent.lifecycle(
                "\n\u001B[33mA new version of tool-name (2.1.0) is available (currently using 2.0.0). "
                    + "Update your build configuration to use the latest features and fixes!\n"
                    + ProjectInfo.GITHUB_URL
                    + "/blob/master/jib-gradle-plugin/CHANGELOG.md\u001B[0m\n\n"
                    + "Please see "
                    + ProjectInfo.GITHUB_URL
                    + "/blob/master/docs/privacy.md for info on disabling this update check.\n"));
  }