default Optional<T> findSingle() throws TooManyElementsException {
        Iterator<T> it = iterator();

        if (!it.hasNext())
            return Optional.empty();

        T result = it.next();
        if (!it.hasNext())
            return Optional.of(result);
            
        throw new TooManyElementsException("Stream contained more than one element.");
    }
Get the single element from the stream, or throw an exception if the
stream holds more than one element.
jOOL/src/main/java/org/jooq/lambda/Seq.java