code: public static ValidationException fromResults(String correlationId, List<ValidationResult> results, boolean strict)
  			throws ValidationException {
  		boolean hasErrors = false;
  		for (ValidationResult result : results) {
  			if (result.getType() == ValidationResultType.Error)
  				hasErrors = true;
  			if (strict && result.getType() == ValidationResultType.Warning)
  				hasErrors = true;
  		}
  
  		return hasErrors ? new ValidationException(correlationId, results) : null;
  	}
docs: Creates a new ValidationException based on errors in validation results. If
  validation results have no errors, than null is returned.
  
  @param correlationId (optional) transaction id to trace execution through
  call chain.
  @param results       list of validation results that may contain errors
  @param strict        true to treat warnings as errors.
  @return a newly created ValidationException or null if no errors in found.
  @throws ValidationException when errors occured in validation.
  
  @see ValidationResult