new XorComparator(lookupId));
for (DHT dht : dhts) {
expected.add(dht.getIdentity().getId());
}
DHT first = dhts.get(0);
NodeConfig config = new NodeConfig();
config.setLookupTimeout(20L, TimeUnit.SECONDS);
DHTFuture<NodeEntity> future
= first.discover(lookupId, config);
NodeEntity entity = future.get();
TestCase.assertEquals(lookupId, entity.getId());
Contact[] contacts = entity.getContacts();
Contact[] closest = entity.getClosest();
// The Contacts in the response should be in the same order
// as our DHT instances!
int k = first.getRouteTable().getK();
for (int i = 0; i < k && i < contacts.length; i++) {
KUID contactId = contacts[i].getId();
KUID closestId = closest[i].getId();
KUID expectedId = expected.pollFirst();