### Question:
TabletSitePathUrlFactory extends AbstractSitePathUrlFactory implements SiteUrlFactory { public String createSiteUrl(HttpServletRequest request) { String urlPath = request.getRequestURI(); if (getCleanMobilePath() != null && urlPath.startsWith(getCleanMobilePath())) { urlPath = urlPath.substring(getCleanMobilePath().length()); } else if (getRootPath() != null && urlPath.startsWith(getCleanRootPath())) { urlPath = urlPath.substring(getCleanRootPath().length()); } urlPath = getCleanTabletPath() + urlPath; return createSiteUrlInternal(request, request.getServerName(), urlPath); } TabletSitePathUrlFactory(final String tabletPath, final String mobilePath);  TabletSitePathUrlFactory(final String tabletPath, final String mobilePath, final String rootPath); boolean isRequestForSite(HttpServletRequest request); String createSiteUrl(HttpServletRequest request);  }### Answer:
@Test public void createRootSiteUrl() { request.setServerPort(80); request.setRequestURI("/bar"); assertEquals("https: }
@Test public void createRootSiteUrlPort8080() { request.setServerPort(8080); request.setRequestURI("/bar"); assertEquals("https: }
@Test public void createPathSiteUrl() { request.setServerPort(80); request.setRequestURI("/showcase/bar"); assertEquals("https: }
@Test public void createPathSiteUrlPort8080() { request.setServerPort(8080); request.setRequestURI("/showcase/bar"); assertEquals("https: }
@Test public void createRootSiteUrlFromMobileSite() { request.setServerPort(80); request.setRequestURI("/mobile/about"); assertEquals("https: }
@Test public void createRootSiteUrlFromMobileSitePort8080() { request.setServerPort(8080); request.setRequestURI("/mobile/about"); assertEquals("https: }
@Test public void createLongRootSiteUrlFromMobileSite() { request.setServerPort(80); request.setRequestURI("/mobile/about/x/y/z/contact"); assertEquals("https: }
@Test public void createPathSiteUrlFromMobileSite() { request.setServerPort(80); request.setRequestURI("/showcase/mobile/about"); assertEquals("https: }
@Test public void createPathSiteUrlFromMobileSitePort8080() { request.setServerPort(8080); request.setRequestURI("/showcase/mobile/about"); assertEquals("https: }
@Test public void createLongPathSiteUrlFromMobileSite() { request.setServerPort(80); request.setRequestURI("/showcase/mobile/about/x/y/z/contact"); assertEquals("https: }
@Test public void createLongPathSiteUrlFromMobileSiteMultipleMobile() { request.setServerPort(80); request.setRequestURI("/showcase/mobile/about/x/mobile/y/z/contact"); assertEquals("https: advPathFactory.createSiteUrl(request)); }
@Test public void createLongPathSiteUrlFromMobileSiteMultipleMobileAndSlashes() { request.setServerPort(80); request.setRequestURI("/showcase/mobile/about assertEquals("https: advPathFactory.createSiteUrl(request)); }