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