void () { n[0] = 0; expression.accept(new JavaRecursiveElementWalkingVisitor() { @Override public void visitExpression(@NotNull PsiExpression expression) { PsiExpression s = expression; super.visitExpression(expression); s.hashCode(); //hold on stack n[0]++; } }); assertEquals(N+2, n[0]); }