code: @SuppressWarnings("unchecked")
     private void verifyBeanValidation(Object as) throws Exception
     {
        if (beanValidation != null)
        {
           ValidatorFactory vf = null;
  
           try
           {
              vf = beanValidation.getValidatorFactory();
              Validator v = vf.getValidator();
  
              Collection<String> l = bvGroups;
              if (l == null || l.isEmpty())
                 l = Arrays.asList(javax.validation.groups.Default.class.getName());
  
              Collection<Class<?>> groups = new ArrayList<>();
              for (String clz : l)
              {
                 groups.add(Class.forName(clz, true, resourceAdapter.getClass().getClassLoader()));
              }
           
              Set failures = v.validate(as, groups.toArray(new Class<?>[groups.size()]));
           
              if (!failures.isEmpty())
              {
                 throw new ConstraintViolationException("Violation for " + as, failures);
              }
           }
           finally
           {
              if (vf != null)
                 vf.close();
           }
        }
     }
docs: Verify activation spec against bean validation
  @param as The activation spec
  @exception Exception Thrown in case of a violation