### Question:
UrlProviderImpl implements UrlProvider { @Override public String toProductUrl(SlingHttpServletRequest request, Page page, Map<String, String> params) { return toUrl(request, page, params, productUrlTemplate, UrlProvider.URL_KEY_PARAM); }  @Activate void activate(UrlProviderConfiguration conf); @Override String toProductUrl(SlingHttpServletRequest request, Page page, Map<String, String> params); @Override String toCategoryUrl(SlingHttpServletRequest request, Page page, Map<String, String> params); static Resource toSpecificPage(Resource page, String selector); @Override Pair<ProductIdentifierType, String> getProductIdentifier(SlingHttpServletRequest request); @Override Pair<CategoryIdentifierType, String> getCategoryIdentifier(SlingHttpServletRequest request);  }### Answer:
@Test public void testProductUrlWithCustomPage() { Map<String, String> params = new ParamsBuilder() .urlKey("beaumont-summit-kit") .page("/content/custom-page") .map(); String url = urlProvider.toProductUrl(request, null, params); Assert.assertEquals("/content/custom-page.beaumont-summit-kit.html", url); }
@Test public void testProductUrlWithSubpageAndAnchor() { Page page = context.currentPage("/content/product-page"); request.setAttribute(WCMMode.class.getName(), WCMMode.EDIT); Map<String, String> params = new ParamsBuilder() .urlKey("productId1") .variantSku("variantSku") .map(); String url = urlProvider.toProductUrl(request, page, params); Assert.assertEquals("/content/product-page/sub-page.productId1.html#variantSku", url); }