code: @SuppressWarnings("unchecked")
      @Nullable
      public final T getUnique() throws IllegalStateException {
          final AtomicReference<Object> holder = new AtomicReference<Object>();
          toHandler(new Handler<T>() {
  
              @Override
              public void handle(final T element) {
                  if (element != null) {
                      if (holder.get() == null) {
                          holder.set(element);
                      } else {
                          holder.set(EOF);
                          Thread.currentThread().interrupt(); // attempt interupting iteration
                      }
                  }
              }
  
          });
          final Object result = holder.get();
          if (result != EOF) {
              return (T) result;
          }
          throw new IllegalStateException("Stream " + this + " returned more than one element");
      }
docs: Terminal operation returning the only element in this Stream, or <tt>null</tt> if there are
  no elements. An exception is thrown in case there is more than one element in the Stream.
  This method is designed for being used with Streams that are expected to return exactly one
  element, for which it embeds the check on the number of elements.
  
  @return the only element in the Stream
  @throws IllegalStateException
  in case there are multiple elements in the Stream