T () { if (myTop != null) { if (myTop instanceof ServiceNode && !((ServiceNode)myTop).isChildrenInitialized() && !((ServiceNode)myTop).isLoaded()) { myNotLoadedQueue.add(myTop); } else { Iterable<? extends T> iterable = tree.fun(myTop); if (iterable != null) { JBIterable.from(iterable).map(ourNotNullizer::notNullize).addAllTo(myQueue); } } myTop = null; } while (!myNotLoadedQueue.isEmpty() && myQueue.isEmpty()) { T notLoaded = myNotLoadedQueue.remove(); Iterable<? extends T> iterable = tree.fun(notLoaded); if (iterable != null) { JBIterable.from(iterable).map(ourNotNullizer::notNullize).addAllTo(myQueue); } } if (myQueue.isEmpty()) { return stop(); } myTop = ourNotNullizer.nullize(myQueue.remove()); return myTop; }