  @Test
  public void isCloserTo() {

    for (int i = 0; i < 1000; i++) {
      KUID lookupId = KUID.createRandom(20);
      
      KUID[] contacts = new KUID[] {
        KUID.createRandom(lookupId),
        KUID.createRandom(lookupId)
      };
      
      Arrays.sort(contacts, new XorComparator(lookupId));
      
      TestCase.assertTrue(contacts[0].isCloserTo(lookupId, contacts[1]));
      TestCase.assertFalse(contacts[1].isCloserTo(lookupId, contacts[0]));
    }
  }