@Override
    public boolean isValid(final String object,
                           final ConstraintValidatorContext constraintContext) {
        if (object == null) {
            return true;
        }

        final int lengthInBytes = object.getBytes(StandardCharsets.UTF_8).length;
        return lengthInBytes >= this.min && lengthInBytes <= this.max;
    }
@Test
    void nullObjectIsValid() {
        assertThat(toTest.isValid(null, null)).isTrue();
    }