code: protected void validateAttachmentContentType(SoapAttachment receivedAttachment, SoapAttachment controlAttachment) {
          //in case contentType was not set in test case, skip validation
          if (!StringUtils.hasText(controlAttachment.getContentType())) { return; }
          
          if (receivedAttachment.getContentType() != null) {
              Assert.isTrue(controlAttachment.getContentType() != null, 
                      buildValidationErrorMessage("Values not equal for attachment contentType", 
                              null, receivedAttachment.getContentType()));
  
              Assert.isTrue(receivedAttachment.getContentType().equals(controlAttachment.getContentType()),
                      buildValidationErrorMessage("Values not equal for attachment contentType", 
                              controlAttachment.getContentType(), receivedAttachment.getContentType()));
          } else {
              Assert.isTrue(controlAttachment.getContentType() == null || controlAttachment.getContentType().length() == 0, 
                      buildValidationErrorMessage("Values not equal for attachment contentType", 
                              controlAttachment.getContentType(), null));
          }
          
          if (log.isDebugEnabled()) {
              log.debug("Validating attachment contentType: " + receivedAttachment.getContentType() + 
                      "='" + controlAttachment.getContentType() + "': OK.");
          }
      }
docs: Validating SOAP attachment content type.
  @param receivedAttachment
  @param controlAttachment