NodeDescriptor (@NotNull Object element, NodeDescriptor parentDescriptor) { if (element instanceof HierarchyNodeDescriptor) { return (HierarchyNodeDescriptor)element; } if (element instanceof String) { return new TextInfoNodeDescriptor(parentDescriptor, (String)element, myProject); } throw new IllegalArgumentException("Unknown element type: " + element); }