@Test
public void testEquals() throws Exception {

    final URIAuthority host1 = new URIAuthority("somehost", 8080);
    final URIAuthority host2 = new URIAuthority("somehost", 80);
    final URIAuthority host3 = new URIAuthority("someotherhost", 8080);
    final URIAuthority host4 = new URIAuthority("somehost", 80);
    final URIAuthority host5 = new URIAuthority("SomeHost", 80);
    final URIAuthority host6 = new URIAuthority("user", "SomeHost", 80);
    final URIAuthority host7 = new URIAuthority("user", "somehost", 80);
    Assert.assertTrue(host1.equals(host1));
    Assert.assertFalse(host1.equals(host2));
    Assert.assertFalse(host1.equals(host3));
    Assert.assertTrue(host2.equals(host4));
    Assert.assertTrue(host2.equals(host5));
    Assert.assertFalse(host5.equals(host6));
    Assert.assertTrue(host6.equals(host7));
}