@Test
public void testEquals() throws Exception {

    HostToken t1 = new HostToken(1L, new HostBuilder().setHostname("foo").setPort(1234).setRack("foo_rack").createHost());
    HostToken t2 = new HostToken(1L, new HostBuilder().setHostname("foo").setPort(1234).setRack("foo_rack").createHost());
    Assert.assertEquals(t1, t2);
    // change token
    HostToken t3 = new HostToken(2L, new HostBuilder().setHostname("foo").setPort(1234).setRack("foo_rack").createHost());
    Assert.assertFalse(t1.equals(t3));
    // change host name
    HostToken t4 = new HostToken(1L, new HostBuilder().setHostname("foo1").setPort(1234).setRack("foo_rack").createHost());
    Assert.assertFalse(t1.equals(t4));
}