Collection<TextMateSnippet> (@NotNull String key, @Nullable TextMateScope scope) { if (scope == null) { return Collections.emptyList(); } Collection<TextMateSnippet> snippets = mySnippets.get(key); if (snippets == null) { return Collections.emptyList(); } return new TextMateScopeComparator<>(scope, TextMateSnippet::getScopeSelector).sortAndFilter(snippets); }