if (receivedAttachment.getContent() != null) {
String controlContent = controlAttachment.getContent();
String receivedContent = receivedAttachment.getContent();
Message controlMessage = new DefaultMessage(controlContent);
validationContext.setControlMessage(controlMessage);
Message receivedMessage = new DefaultMessage(receivedContent);
validator.validateMessage(receivedMessage, null, validationContext);
} else {
Assert.isTrue(controlAttachment.getContent() == null || controlAttachment.getContent().trim().length() == 0,
"Values not equal for attachment content '"
+ controlAttachment.getContentId() + "', expected '"