ValidatorParameterHelper { public OneParamValidator type(String qualifiedName) { return param(new ExactTypeParameterRequirement(qualifiedName)); } ValidatorParameterHelper(TargetAnnotationHelper targetAnnotationHelper); Validator noParam(); OneParamValidator type(String qualifiedName); OneParamValidator extendsType(String qualifiedName); OneParamValidator extendsAnyOfTypes(String... types); OneParamValidator anyType(); OneParamValidator annotatedWith(Class<? extends Annotation> annotationClass); OneParamValidator primitiveOrWrapper(TypeKind primitive); OneParamValidator anyOfTypes(String... types); OneParamValidator param(ParameterRequirement parameterRequirement); InOrderParamValidator inOrder(); AnyOrderParamValidator anyOrder();  }
@Test public void optionalStringParam() throws Exception { ExecutableElement executableElement = createMethod(String.class); ElementValidation valid = new ElementValidation("", executableElement); validator.type(CanonicalNameConstants.STRING).optional().validate(executableElement, valid); assertTrue(valid.isValid()); ExecutableElement withoutArgument = createMethod(); ElementValidation valid2 = new ElementValidation("", executableElement); validator.type(CanonicalNameConstants.STRING).optional().validate(withoutArgument, valid2); assertTrue(valid2.isValid()); }