### Question:
RelativeUriValidator implements ConstraintValidator<RelativeUri, URI> { @Override public boolean isValid(final URI value, final ConstraintValidatorContext context) { return value != null && !value.isAbsolute(); }  @Override void initialize(final RelativeUri constraintAnnotation); @Override boolean isValid(final URI value, final ConstraintValidatorContext context);  }### Answer:
@Test public void nullUrisShouldBeInvalid() { assertThat(validator.isValid(null, null)).isFalse(); }
@Test public void shouldAllowRelativeUris() { assertThat(validator.isValid(URI.create("/relative"), null)).isTrue(); }
@Test public void shouldNotAllowNonRelativeUris() { assertThat(validator.isValid(URI.create("scheme:/absolute"), null)).isFalse(); }