private static void tryAwaitFuture(@NotNull Future<?> future, @NotNull @NlsSafe String taskName) {
    try {
      future.get(1, TimeUnit.SECONDS);
    }
    catch (ExecutionException e) {
      Throwable cause = e.getCause();
      if (cause instanceof CancellationException) {
        // ignore: expected cancellation
      }
      else {
        LOG.error(e);
      }
    }
    catch (CancellationException ignored) {
    }
    catch (InterruptedException | TimeoutException e) {
      LOG.debug("Couldn't await background process on disposal: " + taskName);
    }
  }
private static void tryAwaitFuture(@NotNull Future<?> future, @NotNull @NlsSafe String taskName)