NodeDescriptor (@NotNull Object element, NodeDescriptor parentDescriptor) { if (element == myTreeRoot || element instanceof RadComponent) { TreeNodeDescriptor descriptor = new TreeNodeDescriptor(parentDescriptor, element); descriptor.setWasDeclaredAlwaysLeaf(isAlwaysLeaf(element)); return descriptor; } throw new IllegalArgumentException("Unknown element: " + element); }