### Question:
SiteMapExtractorBase implements SiteMapExtractor { @Override public final boolean appliesTo(final Resource root) { if (isNull(root)) { return false; } return Optional.ofNullable(getConfiguration()) .map(SiteMapConfiguration::getPagePathPattern) .map(p -> p.matcher(root.getPath())) .map(Matcher::matches) .orElse(true) && appliesToImpl(root); }  @Override final boolean appliesTo(final Resource root); @Override List<SiteMapEntry> extract(final Resource root); @Override String buildSiteMapUrl(final Resource siteMapRoot, final int index); @Override int getIndex(final SlingHttpServletRequest request);  }### Answer:
@Test public void appliesTo() { assertFalse(model.appliesTo(null)); assertTrue(model.appliesTo(page)); assertTrue(model.appliesTo(resource)); when(config.getPagePathPattern()).thenReturn(pattern); assertFalse(model.appliesTo(page)); assertTrue(model.appliesTo(resource)); }