As mentioned below, these methods could be replaced with

```
final PageManager pageManager = resourceResolver.adaptTo(PageManager.class);
final Page page = pageManager.getContainingPage(path);
if(page != null) { references.add(page.getPath(); }
```