Collection<TextMateSnippet> (@Nullable TextMateScope scopeSelector) { if (scopeSelector == null) { return Collections.emptyList(); } return new TextMateScopeComparator<>(scopeSelector, TextMateSnippet::getScopeSelector) .sortAndFilter(mySnippets.values().stream().flatMap((values) -> values.stream())); }