protected AbstractValidationRule createValidationRule(Annotation annotation, Class clazz, String propertyName) {
if (Size.class.isInstance(annotation)) {
Size size = (Size) annotation;
return new SizeValidationRule(size.min(), size.max());
}
if (MinSize.class.isInstance(annotation)) {
MinSize minSize = (MinSize) annotation;
return new MinSizeValidationRule(minSize.value());