RefClass (@NotNull RefElement refElement) { LOG.assertTrue(refElement.isInitialized(), refElement.getName() + " not initialized"); RefEntity refParent = refElement.getOwner(); while (refParent instanceof RefElement && !(refParent instanceof RefFile)) { refElement = (RefElement)refParent; refParent = refParent.getOwner(); } return refElement instanceof RefClass refClass ? refClass : null; }