### Question:
ResourceReferencesValidator implements ConstraintValidator<ValidResourceReferences, Map<String, ClientReferenceableFile>>, ValidationErrorDescriptorBuilder { @Override public ErrorDescriptor build(ConstraintViolation violation) { @SuppressWarnings("unchecked") List<String> invalidReferences = findInvalidReferences((Map) violation.getInvalidValue()); ErrorDescriptor errorDescriptor = new ErrorDescriptor().setErrorCode(ValidResourceReferences.ERROR_CODE) .setMessage("The mandatory parameter \"" + MANDATORY_PARAMETER + "\" is missing."); for (String invalidReference : invalidReferences) { errorDescriptor.addProperties(new ClientProperty().setKey(ValidResourceReferences.PROPERTY_INVALID_REFERENCE) .setValue("" + violation.getPropertyPath() + "." + invalidReference)); } return errorDescriptor; }  @Override void initialize(ValidResourceReferences constraintAnnotation); @Override boolean isValid(Map<String, ClientReferenceableFile> value, ConstraintValidatorContext context); @Override ErrorDescriptor build(ConstraintViolation violation);  }### Answer:
@Test public void build_returnsCorrectErrorDescriptor() { ErrorDescriptor errorDescriptor = validator.build(violation); assertEquals(ValidResourceReferences.ERROR_CODE, errorDescriptor.getErrorCode()); assertNotNull(errorDescriptor.getProperties()); assertEquals(1, errorDescriptor.getProperties().size()); assertEquals(ValidResourceReferences.PROPERTY_INVALID_REFERENCE, errorDescriptor.getProperties().get(0).getKey()); assertEquals("resources.dataFile.fileReference.uri", errorDescriptor.getProperties().get(0).getValue()); }