@Test
public void testGetNextAvailableNodeId() {
assertNull(createFor( "n1:localhost:11211", null, null, _mcc ).getNextAvailableNodeId("n1"));
assertEquals(createFor( "n1:localhost:11211,n2:localhost:11212", null, null, _mcc ).getNextAvailableNodeId("n1"), "n2");
final MemcachedClientCallback mcc = mock(MemcachedClientCallback.class);
when(mcc.get(anyString())).thenReturn(null);
when(mcc.get(endsWith("n2"))).thenThrow(new OperationTimeoutException("SimulatedException"));
assertNull(createFor( "n1:localhost:11211,n2:localhost:11212", null, null, mcc).getNextAvailableNodeId("n1"));
assertEquals(createFor( "n1:localhost:11211,n2:localhost:11212,n3:localhost:11213", null, null, mcc).getNextAvailableNodeId("n1"), "n3");
}