@Test
    public void testInvalidApiVersionsRequestSequence() throws Exception {
        SecurityProtocol securityProtocol = SecurityProtocol.SASL_PLAINTEXT;
        configureMechanisms("PLAIN", Collections.singletonList("PLAIN"));
        server = createEchoServer(securityProtocol);

        // Send handshake request followed by ApiVersionsRequest
        String node1 = "invalid1";
        createClientConnection(SecurityProtocol.PLAINTEXT, node1);
        sendHandshakeRequestReceiveResponse(node1, (short) 1);

        ApiVersionsRequest request = createApiVersionsRequestV0();
        RequestHeader versionsHeader = new RequestHeader(ApiKeys.API_VERSIONS, request.version(), "someclient", 2);
        selector.send(new NetworkSend(node1, request.toSend(versionsHeader)));
        NetworkTestUtils.waitForChannelClose(selector, node1, ChannelState.READY.state());
        selector.close();

        // Test good connection still works
        createAndCheckClientConnection(securityProtocol, "good1");
    }
Tests that ApiVersionsRequest after Kafka SASL handshake request flow,
but prior to actual SASL authentication, results in authentication failure.
This is similar to {@link #testUnauthenticatedApiVersionsRequest(SecurityProtocol, short)}
where a non-SASL client is used to send requests that are processed by
{@link SaslServerAuthenticator} of the server prior to client authentication.
clients/src/test/java/org/apache/kafka/common/security/authenticator/SaslAuthenticatorTest.java