code: @Override
    public void validate(Message msg, ValidatorLevel validatorLevel) throws AvpNotAllowedException {
      if (validatorLevel == ValidatorLevel.OFF) {
        return;
      }
  
      // if its !OFF, we will go down, at least to this section
      for (AvpRepresentation ap : this.unmuttableMessageAvps.values()) {
        AvpSet innerSet = msg.getAvps().getAvps(ap.getCode(), ap.getVendorId());
  
        int count = 0;
        if (innerSet != null) {
          count = innerSet.size();
        }
  
        if (!ap.isCountValidForMultiplicity(count)) {
          throw new AvpNotAllowedException("AVP: \n" + ap + "\n, has wrong count in message - " + (count), ap.getCode(), ap.getVendorId());
        }
        // if its ALL, we need to go down deeper in AVPs
        if (validatorLevel != ValidatorLevel.ALL) {
          continue;
        }
        if (count != 0 && ap.isGrouped()) {
          // we are grouped
          validateGrouped(ap, innerSet);
        }
      }
    }
docs: Validation part ----------------------------------------------------------