List<Object> (final Object object) { final List<Object> result = new ArrayList<>(); PairProcessor<Object, NavBarModelExtension> processor = (o, ext) -> { ContainerUtil.addIfNotNull(result, o instanceof PsiElement && ext.normalizeChildren() ? normalize((PsiElement)o) : o); return true; }; processChildrenWithExtensions(object, processor); result.sort(new SiblingsComparator()); return result; }