code: @NotNull
      public Optional<T> findSingle() {
          if (iterator.hasNext()) {
              T singleCandidate = iterator.next();
              if (iterator.hasNext()) {
                  throw new IllegalStateException("Stream contains more than one element");
              } else {
                  return Optional.of(singleCandidate);
              }
          } else {
              return Optional.empty();
          }
      }
docs: Returns the single element wrapped by {@code Optional} class.
  If stream is empty, returns {@code Optional.empty()}.
  If stream contains more than one element, throws {@code IllegalStateException}.
  
  <p>This is a short-circuiting terminal operation.
  
  <p>Example:
  <pre>
  stream: []
  result: Optional.empty()
  
  stream: [1]
  result: Optional.of(1)
  
  stream: [1, 2, 3]
  result: IllegalStateException
  </pre>
  
  @return an {@code Optional} with single element or {@code Optional.empty()} if stream is empty
  @throws IllegalStateException if stream contains more than one element
  @since 1.1.2