code: public static Constraint size(final Number min, final Number max) {
  		return new Constraint("size", sizePayload(min, max)) {
  			public boolean isValid(Object actualValue) {
  				if (actualValue != null && min != null && max != null) {
  					if (actualValue instanceof String) {
  						return !isOutOfRange(((String) actualValue).length(), min, max);
  					} else if (actualValue instanceof Collection) {
  						return !isOutOfRange(((Collection) actualValue).size(), min, max);
  					} else if (actualValue instanceof Map) {
  						return !isOutOfRange(((Map) actualValue).size(), min, max);
  					} else if (actualValue.getClass().isArray()) {
  						return !isOutOfRange(ArrayUtils.getLength(actualValue), min, max);
  					} else {
  						return false;
  					}
  				}
  				return true;
  			}
  		};
  	}
docs: The 'size' constraint - field must be a {@link String}, {@link Map}, {@link Collection} or array
  with a given minimum and maximum length.
  @param min the minimum length
  @param max the maximum length
  @return constraint