protected T getElement()

in src/main/java/org/apache/sling/query/impl/iterator/SiblingsIterator.java [51:67]


    protected T getElement() {
        if (finished) {
            return null;
        }
        while (type.canAdvance(siblings)) {
            T resource = type.advance(siblings);
            if (until != null && until.test(resource)) {
                finished = true;
                return null;
            }
            if (until == null) {
                finished = true;
            }
            return resource;
        }
        return null;
    }