'When factories support L{IProtocolNegotiationFactory} and support
overlapping protocols, the first protocol is negotiated.'

def test_negotiationWithProtocolOverlap(self):

    (client, server, clientDataReceived, serverDataReceived) = self.handshakeProtocols(['h2', 'http/1.1'], ['h2', 'http/1.1'])
    def checkNegotiatedProtocol(ignored):
        self.assertEqual(client.negotiatedProtocol, 'h2')
        self.assertEqual(server.negotiatedProtocol, 'h2')
    clientDataReceived.addCallback((lambda ignored: serverDataReceived))
    serverDataReceived.addCallback(checkNegotiatedProtocol)
    return clientDataReceived
