code: static <A extends Annotation> ImmutableSet<Class<? extends ConstraintValidator<A, ?>>> //
        getValidatorForType(final Class<?> ptype,
            final List<Class<? extends ConstraintValidator<A, ?>>> constraintValidatorClasses) {
      final Class<?> type = Primitives.wrap(ptype);
      final Map<Class<?>, Class<? extends ConstraintValidator<A, ?>>> map = Maps.newHashMap();
      for (final Class<? extends ConstraintValidator<A, ?>> conClass : constraintValidatorClasses) {
        final Class<?> aType = Primitives.wrap(getTypeOfConstraintValidator(conClass));
        if (aType.isAssignableFrom(type)) {
          map.put(aType, conClass);
        }
      }
      // TODO(nchalko) implement per spec
      // Handle Arrays and Generics
  
      final Set<Class<?>> best = Util.findBestMatches(type, map.keySet());
  
      final Predicate<Class<?>> inBest = key -> best.contains(key);
      return ImmutableSet.copyOf(Maps.filterKeys(map, inBest).values());
    }
docs: Visible for testing