@Override
    public Set<String> getValues(Extension object) {
        if (getObjectType().isInstance(object)) {
            return getNonNullValues(getObjectType().cast(object));
        }
        throw new IllegalArgumentException("Object type does not match");
    }
@Test
    void getValues() {
        var attribute = new FunctionalMultiValueIndexAttribute<>(FakeExtension.class,
            FakeExtension::getCategories);
        var fake = new FakeExtension();
        fake.setCategories(Set.of("test", "halo"));
        assertThat(attribute.getValues(fake)).isEqualTo(fake.getCategories());

        var unstructured = Unstructured.OBJECT_MAPPER.convertValue(fake, Unstructured.class);
        assertThatThrownBy(() -> attribute.getValues(unstructured))
            .isInstanceOf(IllegalArgumentException.class)
            .hasMessageContaining("Object type does not match");

        var demoExt = new DemoExtension();
        assertThatThrownBy(() -> attribute.getValues(demoExt))
            .isInstanceOf(IllegalArgumentException.class)
            .hasMessageContaining("Object type does not match");
    }