### Question:
ApplicationURI { @Override public String toString() { StringBuilder url = new StringBuilder(); if (StringUtils.isNotEmpty(getHost())) { url.append(getHost()) .append(UriUtil.DEFAULT_HOST_DOMAIN_SEPARATOR); } url.append(getDomain()); if (StringUtils.isNotEmpty(getPath())) { url.append(getPath()); } return url.toString(); } ApplicationURI(String initial);  ApplicationURI(CloudRoute route); static String getDomainFromURI(String uri); Map<String, Object> getURIParts(); Object getURIPart(String partName); void setURIPart(String partName, String part); @Override String toString(); String getHost(); void setHost(String host); String getDomain(); void setDomain(String domain); String getPath(); void setPath(String path); @Override int hashCode(); @Override boolean equals(Object object);  }### Answer:
@Test void testToStringWithValidHostAndPath() { ApplicationURI applicationURI = new ApplicationURI(createCloudRoute(CUSTOM + "host", createCloudDomain(CUSTOM + "domain"), "/" + CUSTOM + "path")); String expectedApplicationURI = CUSTOM + "host." + CUSTOM + "domain/" + CUSTOM + "path"; Assertions.assertEquals(expectedApplicationURI, applicationURI.toString()); }
@Test void testToStringWithValidHostAndWithoutPath() { ApplicationURI applicationURI = new ApplicationURI(createCloudRoute(CUSTOM + "host", createCloudDomain(CUSTOM + "domain"), null)); Assertions.assertEquals(CUSTOM + "host." + CUSTOM + "domain", applicationURI.toString()); }
@Test void testToStringWithoutHostAndWithoutPath() { ApplicationURI applicationURI = new ApplicationURI(createCloudRoute("", createCloudDomain(CUSTOM + "domain"), null)); Assertions.assertEquals(CUSTOM + "domain", applicationURI.toString()); }