public static <E extends Extension> IndexSpec primaryKeyIndexSpec(Class<E> type) {
        return new IndexSpec()
            .setName(PRIMARY_INDEX_NAME)
            .setOrder(IndexSpec.OrderType.ASC)
            .setUnique(true)
            .setIndexFunc(IndexAttributeFactory.simpleAttribute(type,
                e -> e.getMetadata().getName())
            );
    }
@Test
    void primaryKeyIndexSpec() {
        var spec =
            PrimaryKeySpecUtils.primaryKeyIndexSpec(FakeExtension.class);
        assertThat(spec.getName()).isEqualTo("metadata.name");
        assertThat(spec.getOrder()).isEqualTo(IndexSpec.OrderType.ASC);
        assertThat(spec.isUnique()).isTrue();
        assertThat(spec.getIndexFunc()).isNotNull();
        assertThat(spec.getIndexFunc().getObjectType()).isEqualTo(FakeExtension.class);

        var extension = new FakeExtension();
        extension.setMetadata(new Metadata());
        extension.getMetadata().setName("fake-name-1");

        assertThat(spec.getIndexFunc().getValues(extension))
            .isEqualTo(Set.of("fake-name-1"));
    }