class SdkUpdaterConfigurable implements SearchableConfigurable {

  @VisibleForTesting
  static Pair<HtmlBuilder, HtmlBuilder> getDiskUsageMessages(@Nullable File sdkRoot, long fullInstallationsDownloadSize,
                                                             long patchesDownloadSize, long spaceToBeFreedUp) {
    HtmlBuilder message = new HtmlBuilder();
    message.add("Disk usage:\n");
    boolean issueDiskSpaceWarning = false;
    message.beginList();
    if (spaceToBeFreedUp > 0) {
      message.listItem().add("Disk space that will be freed: " + new Storage(spaceToBeFreedUp).toUiString());
    }
    long totalDownloadSize = patchesDownloadSize + fullInstallationsDownloadSize;
    if (totalDownloadSize > 0) {
      message.listItem().add("Estimated download size: " + new Storage(totalDownloadSize).toUiString());
      long sdkRootUsageAfterInstallation = patchesDownloadSize + ESTIMATED_ZIP_DECOMPRESSION_RATE * fullInstallationsDownloadSize
                                           - spaceToBeFreedUp;
      message.listItem().add("Estimated disk space to be additionally occupied on SDK partition after installation: "
                             + new Storage(sdkRootUsageAfterInstallation).toUiString());
      if (sdkRoot != null) {
        long sdkRootUsableSpace = sdkRoot.getUsableSpace();
        message.listItem().add(String.format("Currently available disk space in SDK root (%1$s): %2$s", sdkRoot.getAbsolutePath(),
                                             new Storage(sdkRootUsableSpace).toUiString()));
        long totalSdkUsableSpace = sdkRootUsableSpace + spaceToBeFreedUp;
        issueDiskSpaceWarning = (totalSdkUsableSpace < sdkRootUsageAfterInstallation);
      }
    }
    message.endList();
    if (issueDiskSpaceWarning) {
      HtmlBuilder warningMessage = new HtmlBuilder();
      warningMessage.beginColor(JBColor.RED)
                    .addBold("WARNING: There might be insufficient disk space to perform this operation. ")
                    .newline().newline()
                    .add("Estimated disk usage is presented below. ")
                    .add("Consider freeing up more disk space before proceeding. ")
                    .endColor()
                    .newline().newline();
      return Pair.of(message, warningMessage);
    }
    return Pair.of(message, null);
  }

}