List<String> (PsiFile file) { return PsiTreeUtil.findChildrenOfType(file, PsiComment.class) .stream() .filter(myPolicy::trackComment) .map(PsiElement::getText) .map(text -> text.replaceAll("[\\s*]+", " ")) .collect(Collectors.toList()); }