docs: protected SoapAttachment findAttachment(SoapMessage soapMessage, SoapAttachment controlAttachment) {
          List<SoapAttachment> attachments = soapMessage.getAttachments();
          Attachment matching = null;
  
          if (controlAttachment.getContentId() == null) {
              if (attachments.size() == 1) {
                  matching = attachments.get(0);
              } else {
                  throw new ValidationException("Found more than one SOAP attachment - need control attachment content id for validation!");
              }
          } else {
              // try to find attachment by its content id
              for (Attachment attachment : attachments) {
                  if (controlAttachment.getContentId() != null &&
                          controlAttachment.getContentId().equals(attachment.getContentId())) {
                      matching = attachment;
                  }
              }
          }
  
          if (matching != null) {
              return SoapAttachment.from(matching);
          } else {
              throw new ValidationException(String.format("Unable to find SOAP attachment with content id '%s'", controlAttachment.getContentId()));
          }
      }