public static Map<String, SearchQueryField> createFromEntityAttributes(final List<EntityAttribute> attributes) {
        Map<String, SearchQueryField> dbFieldMapping = new HashMap<>();
        attributes.stream()
                .filter(attr -> Objects.nonNull(attr.searchable()))
                .filter(EntityAttribute::searchable)
                .forEach(attr -> {
                    final SearchQueryField searchQueryField = SearchQueryField.create(
                            attr.id(),
                            attr.type()
                    );
                    dbFieldMapping.put(attr.id(), searchQueryField);
                    if (!attr.title().contains(" ")) {
                        dbFieldMapping.put(attr.title().toLowerCase(Locale.ROOT), searchQueryField);
                    }
                });
        return dbFieldMapping;
    }
@Test
    void createsMappingForBothIdAndTitle() {
        final Map<String, SearchQueryField> result = DbFieldMappingCreator.createFromEntityAttributes(
                List.of(
                        EntityAttribute.builder().id("name").title("Nickname").searchable(true).type(SearchQueryField.Type.STRING).build()
                )
        );
        assertThat(result.size())
                .isEqualTo(2);

        assertThat(result.get("name"))
                .isSameAs(result.get("nickname"))
                .satisfies(sField -> assertThat(sField.getDbField()).isEqualTo("name"))
                .satisfies(sField -> assertThat(sField.getFieldType()).isEqualTo(SearchQueryField.Type.STRING));

        assertThat(result.get("Nickname")).isNull(); //title has been automatically changed to lowercase
    }