@SuppressWarnings({"rawtypes", "unchecked"})
    public static Message validateInboundMessageAndGet(MessageInput messageInput, Element referenceXml) {
        final String referenceXmlString = referenceXml.asXML();
        try {
            return (Message) messageInput.parse(new ReadBufferXmlBased(new ByteArrayInputStream(referenceXmlString.getBytes(StandardCharsets.UTF_8))));
        } catch (RuntimeException | ParseException e) {
            throw new DriverTestsuiteException(String.format("Error parsing message from:\n%s", referenceXmlString), e);
        }
    }
Validates a inbound message and migrates it to the expectation if the parameter {@code autoMigrate} is set to true

@param messageInput    the pre-constructed MessageInput
@param referenceXml    the xml we expect the outbound messag
@return the message if all went well
plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/migration/MessageValidatorAndMigrator.java