### Question:
HttpRequest extends StreamHandler { void setUri() { if (isConnect()) { uri = ""; return; } String withHost = firstLine().substring(firstLine().indexOf(" "), firstLine().lastIndexOf(" ")).trim(); uri = stripHostName(withHost, host, isSSL()); } HttpRequest();  HttpRequest(final InputStream in);  HttpRequest(final InputStream in, final boolean isSSLSocket); @Override String toString(); String host(); int port(); void setHost(final String host); boolean isPost(); boolean isPut(); boolean isDelete(); boolean isGet(); boolean isConnect(); boolean isSSL(); String method(); String uri(); String protocol(); String queryString(); String getParameter(String key); HttpRequest modifyForFetch(); Session session(); String sahiCookie(); String fileExtension(); String fileName(); String url(); boolean isMultipart(); void setSSL(boolean isSSL); boolean isIE(); boolean isAjax(); String referer(); boolean isExcluded();  }### Answer:
@Test public void testSetUri() { assertEquals("/login?service=http: new HttpRequest().stripHostName("/login?service=http: assertEquals("/login?service=http: new HttpRequest().stripHostName("http: "www.hostname.com", false)); assertEquals("/netdirector/", new HttpRequest().stripHostName("http: assertEquals("/netdirector/", new HttpRequest().stripHostName("/netdirector/", "localhost", false)); assertEquals("/netdirector/?service=http: new HttpRequest().stripHostName("http: }