### Question:
PortForwarderTCPProxyEngine extends AbstractTCPProxyEngine { public void run() { while (true) { final Socket localSocket; try { localSocket = accept(); } catch (IOException e) { UncheckedInterruptedException.ioException(e); logIOException(e); return; } final EndPoint sourceEndPoint = EndPoint.clientEndPoint(localSocket); final EndPoint targetEndPoint = m_connectionDetails.getRemoteEndPoint(); try { final Socket remoteSocket = getSocketFactory().createClientSocket(targetEndPoint); launchThreadPair(localSocket, remoteSocket, sourceEndPoint, targetEndPoint, m_connectionDetails.isSecure()); } catch (IOException e) { UncheckedInterruptedException.ioException(e); logIOException(e); try { localSocket.close(); } catch (IOException closeException) { throw new AssertionError(closeException); } } } } PortForwarderTCPProxyEngine(TCPProxyFilter requestFilter,
                                     TCPProxyFilter responseFilter,
                                     PrintWriter output,
                                     Logger logger,
                                     ConnectionDetails connectionDetails,
                                     boolean useColour,
                                     int timeout);  PortForwarderTCPProxyEngine(TCPProxySocketFactory socketFactory,
                                     TCPProxyFilter requestFilter,
                                     TCPProxyFilter responseFilter,
                                     PrintWriter output,
                                     Logger logger,
                                     ConnectionDetails connectionDetails,
                                     boolean useColour,
                                     int timeout); void run();  }### Answer:
@Test public void testTimeOut() throws Exception { final ConnectionDetails connectionDetails = new ConnectionDetails(new EndPoint("localhost", m_localPort), new EndPoint("wherever", 9999), false); final TCPProxyEngine engine = new PortForwarderTCPProxyEngine(m_requestFilter, m_responseFilter, m_out, m_logger, connectionDetails, false, 10); resetLogger(); engine.run(); verify(m_logger).error("Listen time out"); verifyNoMoreInteractions(m_logger); }