@Test
public void testInvalidValue() {

    ConstraintValidatorContext context = mock(ConstraintValidatorContext.class);
    ConstraintViolationBuilder builder = mock(ConstraintViolationBuilder.class);
    when(context.buildConstraintViolationWithTemplate(anyString())).thenReturn(builder);
    NodeBuilderDefinedContext nodeBuilderContext = mock(NodeBuilderDefinedContext.class);
    when(builder.addNode(anyString())).thenReturn(nodeBuilderContext);
    when(params.getVersion()).thenReturn(PdfVersion.VERSION_1_2);
    when(params.getMinRequiredPdfVersion()).thenReturn(PdfVersion.VERSION_1_5);
    assertFalse(victim.isValid(params, context));
    verify(context).buildConstraintViolationWithTemplate(anyString());
}