@Test(expected = ProtocolException.class)
public void shouldThrowProtocolExceptionOnMalformedHeaders() throws Exception {

    when(headersParser.parse(any(String.class))).thenThrow(new MalformedInputException("ANY"));
    factory.createFromSocket(socket);
}