void (Visitor visitor) { final PsiElement[] elements = getChildren(); //noinspection ForLoopReplaceableByForEach for (int i = 0; i < elements.length; i++) { PsiElement element = elements[i]; if (element instanceof CommonElement) { ((CommonElement<?>)element).accept(visitor); } } }