@Test
public void shouldHandleServerRunnable() throws Exception {

    ServerRunnable runnable = new ServerRunnable(mock(Socket.class), mock(ServerConfig.class),
            mock(HttpServletRequestImplFactory.class), factory,
            mock(HttpErrorHandlerResolver.class), mock(PathHelper.class));
    serviceUnavailableHandler.rejectedExecution(runnable, null);
    verify(factory, times(1)).createFromSocket(any(Socket.class));
    printWriter.flush();
    assertThat(outputStream.toString(), containsString("503"));
}