code: public int count(String messageKey, Severity severity) {
          int count = 0;
          if (severity == null || messageKey == null) {
              return count;
          }
  
          for (ValidationResult result : results) {
              for (ValidationMessage<Origin> message : result.getMessages()) {
                  if (messageKey.equals(message.getMessageKey())
                          && severity.equals(message.getSeverity())) {
                      count++;
                  }
              }
          }
          return count;
      }
docs: Counts validation messages by its severity and message key.
  
  @param messageKey a message key of the messages which should be counted
  @param severity a severity of the messages which should be counted
  @return a number of validation messages with provided severity and
  message key