private boolean regionCanBeRemovedWhenCollapsed(@NotNull FoldRegion region) {
    return Boolean.TRUE.equals(region.getUserData(CAN_BE_REMOVED_WHEN_COLLAPSED)) ||
           ((FoldingModelEx)myEditor.getFoldingModel()).hasDocumentRegionChangedFor(region) ||
           !region.isValid() ||
           isRegionInCaretLine(region);
  }
private boolean regionCanBeRemovedWhenCollapsed(@NotNull FoldRegion region)