### Question:
DomainRuntime implements Serializable { public static URL buildServerBaseUrl(final Domain domain, final URL requestUrl, final String requestContextPath) { final String protocol = requestUrl.getProtocol(); StringBuilder host = new StringBuilder(); if (!StringUtils.isEmpty(domain.getServerHost())) { host.append(domain.getServerHost()).append('.'); } host.append(domain.getName()); final int port = requestUrl.getPort(); final String path = requestContextPath + "/"; try { return new URL(protocol, host.toString(), port, path); } catch (MalformedURLException e) { throw new IllegalArgumentException(e); } }  static URL buildServerBaseUrl(final Domain domain,
			final URL requestUrl, final String requestContextPath); static URL buildEndpointUrl(final Domain domain,
			final URL serverBaseUrl); URL getServerBaseUrl(); void setServerBaseUrl(final URL serverBaseUrl); URL getEndpointUrl(); void setEndpointUrl(final URL endpointUrl);  }### Answer:
@Test public void testHttp() throws MalformedURLException { Domain domain = new Domain("example.com", Domain.TYPE_SUBDOMAIN, "www"); URL requestUrl = new URL("http: String requestContextPath = "/joids"; URL serverBaseUrl = DomainRuntime.buildServerBaseUrl(domain, requestUrl, requestContextPath); assertEquals(new URL("http: }