@NotNull
  public <T extends PsiElement> List<T> getPostCommitChangedElements(@NotNull Project project,
                                                                     @NotNull Change change,
                                                                     @NotNull Function<? super VirtualFile, ? extends List<T>> elementExtractor) {
    if (change.getType() == Change.Type.DELETED) return emptyList();

    VirtualFile file = ChangesUtil.getFilePath(change).getVirtualFile();
    if (file == null) return emptyList();

    Document document = FileDocumentManager.getInstance().getDocument(file);
    if (document == null) return emptyList();

    List<T> apply = elementExtractor.fun(file);
    List<T> elements = apply == null ? null : ContainerUtil.skipNulls(apply);
    if (ContainerUtil.isEmpty(elements)) return emptyList();

    if (change.getType() == Change.Type.NEW) return elements;

    List<? extends Range> ranges = getChangedRangesForPostCommit(document, change);
    if (ranges == null) return elements; // assume the whole file is changed

    BitSet changedLines = createChangedLinesBitSet(ranges);
    return ContainerUtil.filter(elements, element -> isElementChanged(element, document, changedLines));
  }
@NotNull
  public <T extends PsiElement> List<T> getPostCommitChangedElements(@NotNull Project project,
                                                                     @NotNull Change change,
                                                                     @NotNull Function<? super VirtualFile, ? extends List<T>> elementExtractor)