@ApiStatus.Internal
  public int getEndOffset(@NotNull FoldingGroup group) {
    List<FoldRegion> regions = getGroupedRegions(group);
    int endOffset = 0;
    for (FoldRegion region : regions) {
      if (region.isValid()) {
        endOffset = Math.max(endOffset, region.getEndOffset());
      }
    }
    return endOffset;
  }
@ApiStatus.Internal
  public int getEndOffset(@NotNull FoldingGroup group)