### Question:
SimpleClient implements Client, IoHandler { public static final long calcNextTimeout(int currentCount, long currentTime) { int count = (currentCount+1)%10; long nextTimeout = 1000 * 2<<count; logger.debug("Next timeout will be after {} millis", nextTimeout); nextTimeout = currentTime + nextTimeout; return nextTimeout; } SimpleClient(IoFilter filter, String remoteHost, int remotePort);  SimpleClient(IoFilter filter, IoHandler handler, 
			String remoteHost, int remotePort); @Override int getConnectTimeout(); String getConnectKey(); @Override void setConnectTimeout(int connectTimeout); @Override Object getHeartBeatMessage(); @Override void setHeartBeatMessage(Object heartBeatMessage); @Override IoFutureListener<IoFuture> getStatListener(); @Override void setStatListener(IoFutureListener<IoFuture> statListener); boolean isResourceProtected(); void setResourceProtected(boolean isResourceProtected); @Override int getHeartBeatSecond(); @Override void setHeartBeatSecond(int heartBeatMillis); @Override boolean connectToServer(); @Override boolean disconnectFromServer(); @Override WriteFuture sendMessageToServer(Object msg); @Override void sessionOpened(IoSession session); @Override void sessionCreated(IoSession session); @Override void sessionClosed(IoSession session); @Override void sessionIdle(IoSession session, IdleStatus status); @Override void exceptionCaught(IoSession session, Throwable cause); @Override void messageReceived(IoSession session, Object message); @Override void messageSent(IoSession session, Object message); static final long calcNextTimeout(int currentCount, long currentTime); @Override String toString(); IoSession getIoSession(); static final String TIME_OUT_MAP_KEY; }### Answer:
@Test public void testCalcNextTimeout() { int count = 0; long nextTimeout = SimpleClient.calcNextTimeout(count++, 0); assertEquals(4000, nextTimeout); nextTimeout = SimpleClient.calcNextTimeout(count++, 0); assertEquals(8000, nextTimeout); nextTimeout = SimpleClient.calcNextTimeout(count++, 0); assertEquals(16000, nextTimeout); nextTimeout = SimpleClient.calcNextTimeout(count++, 0); assertEquals(32000, nextTimeout); nextTimeout = SimpleClient.calcNextTimeout(count++, 0); assertEquals(64000, nextTimeout); nextTimeout = SimpleClient.calcNextTimeout(count++, 0); assertEquals(128000, nextTimeout); nextTimeout = SimpleClient.calcNextTimeout(count++, 0); assertEquals(256000, nextTimeout); nextTimeout = SimpleClient.calcNextTimeout(count++, 0); assertEquals(512000, nextTimeout); nextTimeout = SimpleClient.calcNextTimeout(count++, 0); assertEquals(1024000, nextTimeout); nextTimeout = SimpleClient.calcNextTimeout(count++, 0); assertEquals(2000, nextTimeout); nextTimeout = SimpleClient.calcNextTimeout(count++, 0); assertEquals(4000, nextTimeout); }