ObjectReference (@Nullable ObjectReference objRef) { if (objRef == null || !isValid()) return null; if (myIterationCount <= 0) return objRef; ObjectReference thisRef = objRef; for (int idx = 0; idx < myIterationCount && thisRef != null; idx++) { thisRef = getOuterObject(thisRef); } return thisRef; }