public boolean hasNext() {
        return (alignment != null || stopsIterator.hasNext()) && 
                ((alignment != null && duration <= maxDuration && alignment.startPoint + duration <= intervalsUpperBound) || stopsIterator.hasNext());
    }