Generate the next subset in a newly allocated {@link LinkedHashSet}.

@return next subset stored in newly allocated {@link LinkedHashSet}.
@throws NoSuchElementException if there is no next subset to be generated
320414
@Override
    public Set<T> next() {
        Set<T> subset = new LinkedHashSet<>();
        next(subset);
        return subset;
    }
369390
@Override
    public Set<K> keySet() {
        try {
            lockAllSegments();
            Set<K> set = new HashSet<>();
            for (LinkedHashMapSegment<K, V> seg : segments) {
                set.addAll(seg.keySet());
            }
            return set;
        } finally {
            unlockAllSegments();
        }
    }
363751
public static <T> Set<T> toSet(Iterator<T> iterator)
    {
        Objects.requireNonNull(iterator, "The iterator is null");
        return Iterators.toCollection(iterator, new LinkedHashSet<T>());
    }
809810
public String next() {
        if (next == null)
            throw new NoSuchElementException();
        String replacement = replacementMap.get(next);
        replacement = (replacement == null) ? next : replacement;
        advance();
        return replacement;
    }
886981
public java.util.Iterator iterator() {
        // TODO Bug in remove from a concurrentSet/Map iterator, it does not actually do the remove!
        java.util.Set combinedSet = new java.util.HashSet();
        if (subSets != null) {
            for (int i = 0; i < subSets.length; i++) {
                synchronized (subSets[i]) {
                    combinedSet.addAll(subSets[i]);
                } // synchronized (subSet).
            }
        }
        return combinedSet.iterator();
    }
622615
public static <E> LinkedHashSet<E> newLinkedHashSet(Iterable<? extends E> elements) {
		if (elements instanceof Collection) {
			return new LinkedHashSet<E>((Collection<? extends E>)elements);
		}
		LinkedHashSet<E> set = newLinkedHashSet();
		for (E element : elements) {
			set.add(element);
		}
		return set;
	}
752927
@Override
	public T next() {
		if (hasNext()) {
			T current = next;
			next = null;
			return current;
		} else {
			throw new NoSuchElementException();
		}
	}
32391
public NodeIterator nodeset() throws javax.xml.transform.TransformerException
  {
    return new org.apache.xml.dtm.ref.DTMNodeIterator(iter());
  }
170424
@Override
    public String nextToken()
        throws NoSuchElementException
    {
        if (!hasMoreTokens() || _token==null)
            throw new NoSuchElementException();
        String t=_token.toString();
        _token.setLength(0);
        _hasToken=false;
        return t;
    }
1096597
@Override
    public Element nextElement()
                    throws NoSuchElementException
    {

        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        // If the current bucket has been exhausted, try to find
        // another non-empty bucket.
        if (ivElementIndex >= ivBucketSize)
        {
            if (!findNextBucket()) {
                // No more non-empty buckets, no more elements
                throw new NoSuchElementException();
            }
        }

        // Return the next element from the current bucket.
        // Note that we do not have to worry about concurrent
        // access to the bucket, as this is actually a copy
        // of the bucket, and not the actual bucket in
        // the Cache being enumerated.

        if (isTraceOn && tc.isDebugEnabled())
            ivElementsReturned++;

        return ivBucket[ivElementIndex++];
    }
1087581
@Override
  public T next() {
    Assert.isTrue(hasNext(), new NoSuchElementException("The iteration has no more elements!"));
    T nextValue = iteratorList.get(currentIteratorIndex).next();
    currentIteratorIndex = (++currentIteratorIndex % iteratorList.size());
    nextCalled.set(true);
    return nextValue;
  }
408538
public QueryTerm next() {
		if (nextElement == null) {
			throw new NoSuchElementException();
		}
		QueryTerm t = nextElement;
		nextElement = findNext();
		return t;
	}
128983
public static <T> HashSet<T> newHashSet(final Iterable<? extends T> iterable) {
    final HashSet<T> set = newHashSet();
    for (final T t : iterable) {
      set.add(t);
    }
    return set;
  }
591642
@Override
    public Token next() {
        if (!hasNext())
            throw new NoSuchElementException();
        Token t = this.tok;
        this.tok = null;
        return t;
    }
1282442
public T next() {
		if(cachedNext == null) {
			throw new NoSuchElementException("call hasNext first!");
		}
		T o = cachedNext;
		cachedNext = null;
		return o;
	}
1079638
public static <T> Set<T> toSorted(SortedSet<T> self) {
        return new LinkedHashSet<T>(self);
    }
875913
public Object next() {
        try {
            if (!_primed) {
                _primed = _rs.next();
                if (!_primed) {
                    throw new NoSuchElementException();
                }
            }
            // reset upon consumption
            _primed = false;
            return _rowMapper.mapRowToReturnType();
        } catch (SQLException e) {
            // Since Iterator interface is locked, all we can do
            // is put the real exception inside an expected one.
            NoSuchElementException xNoSuch = new NoSuchElementException("ResultSet exception: " + e);
            xNoSuch.initCause(e);
            throw xNoSuch;
        }
    }