@Test
public void shouldNotAllowInvalidBinaryValues() throws Exception {

    NodeType constrainedType = validateTypeDefinition();
    JcrPropertyDefinition prop = propertyDefinitionFor(constrainedType, TestLexicon.CONSTRAINED_BINARY);
    // Making assumption that String.getBytes().length = String.length() on the platform's default encoding
    Value[] values = new Value[] {valueFor(stringOfLength(4), PropertyType.BINARY),
        valueFor(stringOfLength(10), PropertyType.BINARY), valueFor(stringOfLength(20), PropertyType.BINARY),};
    assertThat(satisfiesConstraints(prop, new Value[] {valueFor(stringOfLength(9), PropertyType.BINARY)}), is(false));
    assertThat(satisfiesConstraints(prop, values), is(false));
}