when(preferredNode.getSocketAddress()).thenReturn(preferredAddress);
when(otherNode1.getSocketAddress()).thenReturn(otherAddress1);
when(otherNode2.getSocketAddress()).thenReturn(otherAddress2);
assertTrue(preference.preferred(preferredNode));
assertFalse(preference.preferred(otherNode1));
assertFalse(preference.preferred(otherNode2));
}
}