private static @NotNull List<? extends Segment> calcFocusZones(@NotNull FocusModeProvider focusModeProvider, @NotNull PsiFile psiFile) {
    Ref<List<? extends Segment>> resultRef = Ref.create();
    long executionTime = TimeoutUtil.measureExecutionTime(() -> resultRef.set(focusModeProvider.calcFocusZones(psiFile)));
    if (executionTime > MAX_ALLOWED_TIME) {
      LOG.warn("Focus zones collecting took too long: " + executionTime + "ms; " +
               "Provider: " + focusModeProvider.getClass().getSimpleName() + "; " +
               "File size: " + psiFile.getTextLength() + "; " +
               "Ranges collected: " + resultRef.get().size());
    }
    return resultRef.get();
  }
private static @NotNull List<? extends Segment> calcFocusZones(@NotNull FocusModeProvider focusModeProvider, @NotNull PsiFile psiFile)