List<StreamChain> (@NotNull PsiElement startElement) { final MyChainCollectorVisitor visitor = new MyChainCollectorVisitor(); PsiElement current = getLatestElementInCurrentScope(PsiUtil.ignoreWhiteSpaces(startElement)); while (current != null) { current.accept(visitor); current = toUpperLevel(current); } final List<List<PsiMethodCallExpression>> chains = visitor.getPsiChains(); return buildChains(chains, startElement); }