@Test
public void getDomain() throws Exception {

    assertNull(Strings.getDomain(null));
    assertEquals("", Strings.getDomain(""));
    assertEquals("a", Strings.getDomain("a"));
    assertEquals("http://acme.com", Strings.getDomain("http://acme.com"));
    assertEquals("http://acme.com", Strings.getDomain("http://acme.com/"));
    assertEquals("http://acme.com", Strings.getDomain("http://acme.com/foo"));
    assertEquals("http://acme.com:1234", Strings.getDomain("http://acme.com:1234?"));
    assertEquals("http://acme.com:1234", Strings.getDomain("http://acme.com:1234?foo=bar/index.html#id"));
}