### Question:
PageRootProviderMultiImpl implements PageRootProvider { @Override public String getRootPagePath(String resourcePath) { for (PageRootProviderConfig config : this.configList) { for (Pattern pattern : config.getPageRootPatterns()) { final Matcher matcher = pattern.matcher(resourcePath); if (matcher.find()) { String rootPath = matcher.group(1); log.debug("Page Root found at [ {} ]", rootPath); return rootPath; } } } log.debug("Resource path does not include the configured page root path."); return null; }  @Override Page getRootPage(Resource resource); @Override String getRootPagePath(String resourcePath);  }### Answer:
@Test public void getRootPagePath() throws Exception { when(config1.getPageRootPatterns()).thenReturn(Arrays.asList(buildPattern("/content"))); provider.bindConfig(config1, FIRST); assertEquals("/content", provider.getRootPagePath("/content/site/en_us/products/product-x")); assertEquals("/content", provider.getRootPagePath("/content/site/en_us/products/product-x/jcr:content/my-component")); assertEquals("/content", provider.getRootPagePath("/content/site/en_us")); assertEquals("/content", provider.getRootPagePath("/content/")); assertEquals("/content", provider.getRootPagePath("/content")); assertNull("/content", provider.getRootPagePath("/etc/site")); assertNull("/content", provider.getRootPagePath("/conf/site")); }