List<IdIndexEntry> (@NotNull String name, boolean caseSensitively) { List<String> words = StringUtil.getWordsInStringLongestFirst(name); if (words.isEmpty()) { String trimmed = name.trim(); if (StringUtil.isNotEmpty(trimmed)) { words = Collections.singletonList(trimmed); } } if (words.isEmpty()) return Collections.emptyList(); return ContainerUtil.map(words, word -> new IdIndexEntry(word, caseSensitively)); }