RefEntityContainer<Descriptor> () { if (myEntity == null) return null; final RefEntity entity = myEntity.getOwner(); return entity instanceof RefElement && !(entity instanceof RefDirectory) ? new RefEntityContainer<>(entity, myDescriptors) : null; }