### Question:
MobileSitePathUrlFactory extends AbstractSitePathUrlFactory implements SiteUrlFactory { public String createSiteUrl(HttpServletRequest request) { String urlPath = request.getRequestURI(); if (getCleanTabletPath() != null && urlPath.startsWith(getCleanTabletPath())) { urlPath = urlPath.substring(getCleanTabletPath().length()); } else if (getRootPath() != null && urlPath.startsWith(getCleanRootPath())) { urlPath = urlPath.substring(getCleanRootPath().length()); } urlPath = getCleanMobilePath() + urlPath; return createSiteUrlInternal(request, request.getServerName(), urlPath); } MobileSitePathUrlFactory(final String mobilePath, final String tabletPath);  MobileSitePathUrlFactory(final String mobilePath, final String tabletPath, 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 createPathSiteUrlPort8080withQueryString() { request.setServerPort(8080); request.setRequestURI("/showcase/bar?xval=123&yval=456"); assertEquals("https: }
@Test public void createRootSiteUrlFromTabletSite() { request.setServerPort(80); request.setRequestURI("/tablet/about"); assertEquals("https: }
@Test public void createRootSiteUrlFromTabletSitePort8080() { request.setServerPort(8080); request.setRequestURI("/tablet/about"); assertEquals("https: }
@Test public void createLongRootSiteUrlFromTabletSite() { request.setServerPort(80); request.setRequestURI("/tablet/about/x/y/z/contact"); assertEquals("https: }
@Test public void createPathSiteUrlFromTabletSite() { request.setServerPort(80); request.setRequestURI("/showcase/tablet/about"); assertEquals("https: }
@Test public void createPathSiteUrlFromTabletSitePort8080() { request.setServerPort(8080); request.setRequestURI("/showcase/tablet/about"); assertEquals("https: }
@Test public void createPathSiteUrlFromTabletSitePort8080withQueryString() { request.setServerPort(8080); request.setRequestURI("/showcase/tablet/about?x=123"); assertEquals("https: }
@Test public void createLongPathSiteUrlFromTabletSite() { request.setServerPort(80); request.setRequestURI("/showcase/tablet/about/x/y/z/contact"); assertEquals("https: }
@Test public void createLongPathSiteUrlFromTabletSiteMultipleTablet() { request.setServerPort(80); request.setRequestURI("/showcase/tablet/about/x/y/tablet/z/contact"); assertEquals("https: advPathFactory.createSiteUrl(request)); }
@Test public void createLongPathSiteUrlFromTabletSiteMultipleTabletAndSlashes() { request.setServerPort(80); request.setRequestURI("/showcase/tablet assertEquals("https: advPathFactory.createSiteUrl(request)); }