RegExpGroup (@NotNull String groupName, PsiFile file) { return SyntaxTraverser.psiTraverser(file) .filter(RegExpGroup.class) .filter(group -> Objects.equals(groupName, group.getGroupName())) .first(); }