for (Iterator<Slot> slotsIter = domainClass.getSlots(); slotsIter.hasNext();) { Slot slot = (Slot) slotsIter.next(); if (slot.getName().equals(slotName)) { return slot;
DomainClass domainClassIter = domainClass; while(domainClassIter != null){  for (Iterator<Slot> slotsIter = domainClassIter.getSlots(); slotsIter.hasNext();) { Slot slot = (Slot) slotsIter.next(); if (slot.getName().equals(slotName)) { return slot; }
    private static Slot findSlotByName(DomainClass domainClass, String slotName) {        for (Iterator<Slot> slotsIter = domainClass.getSlots(); slotsIter.hasNext();) {            Slot slot = (Slot) slotsIter.next();            if (slot.getName().equals(slotName)) {                return slot;            }        }        return null;    }