### Question:
ReferenceFinder { public List<Pair<String, String>> getAllReferences() { return allReferences; } ReferenceFinder(ResourceResolver resolver, String reference, String searchRoot, boolean exact); List<Pair<String, String>> getAllReferences(); List<String> getPublishedReferences();  }### Answer:
@Test public void findExactReferences() { ReferenceFinder finder = new ReferenceFinder(ctx.resourceResolver(), "workflow:wcm", "/content", true) { protected Stream<Resource> findReferences(ResourceResolver resolver, String reference, String searchRoot) { return foundResources.stream(); } }; assertEquals(2, finder.getAllReferences().size()); }
@Test public void findContainsReferences() { ReferenceFinder finder = new ReferenceFinder(ctx.resourceResolver(), "workflow:wcm", "/content", false) { protected Stream<Resource> findReferences(ResourceResolver resolver, String reference, String searchRoot) { return foundResources.stream(); } }; assertEquals(4, finder.getAllReferences().size()); }