Socks5Pair { public void close() { if(requester != null) { requester.close(false); } if(target != null) { target.close(false); } registry.close(hash); } Socks5Pair(IoSession target, Socks5ConnectionsRegistry registry, String hash); synchronized IoSession getOther(IoSession session); synchronized IoSession getRequester(); synchronized void setRequester(IoSession requester); IoSession getTarget(); boolean isActivated(); void activate(); void close();  }
@Test public void close() { Socks5Pair pair = new Socks5Pair(target, connectionsRegistry, hash); pair.setRequester(requester); pair.close(); verify(target).close(false); verify(requester).close(false); }