public static boolean isContentType(String contentType,Message message){
  if (contentType == null) {
    return message.getContentType() == null;
  }
 else {
    return contentType.equals(message.getContentType());
  }
}

public static boolean isContentType ( String contentType , Message message ) { if ( contentType == null ) { return message . getContentType ( ) == null ; } else { return contentType . equals ( message . getContentType ( ) ) ; } }
check whether the content - type field of the properties section ( if present ) in the given message matches the provided string ( where null matches if there is no content type present .
