code: protected MESSAGES toUserMessages(Object form, Set<ConstraintViolation<Object>> vioSet) {
          final TreeMap<String, Object> orderedMap = prepareOrderedMap(form, vioSet);
          final MESSAGES messages = prepareActionMessages();
          for (Entry<String, Object> entry : orderedMap.entrySet()) {
              final Object holder = entry.getValue();
              if (holder instanceof ConstraintViolation) {
                  @SuppressWarnings("unchecked")
                  final ConstraintViolation<Object> vio = (ConstraintViolation<Object>) holder;
                  registerActionMessage(messages, vio);
              } else if (holder instanceof List<?>) {
                  @SuppressWarnings("unchecked")
                  final List<ConstraintViolation<Object>> vioList = ((List<ConstraintViolation<Object>>) holder);
                  for (ConstraintViolation<Object> vio : vioList) {
                      registerActionMessage(messages, vio);
                  }
              } else {
                  throw new IllegalStateException("Unknown type of holder: " + holder);
              }
          }
          return messages;
      }
docs: =============