private static <T extends Inlay<?>> List<T> getElementsInRange(@NotNull IntervalTreeImpl<? extends T> tree,
                                                                 int startOffset,
                                                                 int endOffset,
                                                                 Predicate<? super T> predicate,
                                                                 Comparator<? super T> comparator) {
    List<T> result = new ArrayList<>();
    tree.processOverlappingWith(startOffset, endOffset, inlay -> {
      if (predicate.test(inlay)) result.add(inlay);
      return true;
    });
    result.sort(comparator);
    return result;
  }
private static <T extends Inlay<?>> List<T> getElementsInRange(@NotNull IntervalTreeImpl<? extends T> tree,
                                                                 int startOffset,
                                                                 int endOffset,
                                                                 Predicate<? super T> predicate,
                                                                 Comparator<? super T> comparator)