@Override
    public boolean isValid(Object value, ConstraintValidatorContext context) {
        if (value == null) {
            return true;
        } else if (value instanceof Collection) {
            return isValidCollection((Collection<?>) value);
        } else if (value instanceof Map) {
            return ((Map<?, ?>) value).values().stream().allMatch(v -> isValid(v, context));
        } else {
            return false;
        }
    }
@Test
    public void testInvalidWithNonMatchingObject() {
        boolean valid = target.isValid(new Object(), constraintValidatorContext);
        assertThat(valid).isFalse();
    }