private static void validateConnection(
            final int idx,
            final StubConnection conn,
            final AtomicReference<String> accept) {
        // Only validate connections that we have responses for
        StubResponse resp = conn.getResponse();
        if (resp == null) {
            return;
        }

        try {
            assertChunkedEncoding(conn);
            assertHTTPMethod(conn);
            assertContentType(conn);
            assertRequestContentEncoding(conn, accept);
        } catch (AssertionError err) {
            LOG.info("Assertion failed for connection #" + idx + ": "
                    + err.getMessage());
            throw(err);
        }
    }