code: @NullableDecl
    public static <T> T getOnlyElement(Iterator<? extends T> iterator, @NullableDecl T defaultValue) {
      return iterator.hasNext() ? getOnlyElement(iterator) : defaultValue;
    }
docs: Returns the single element contained in {@code iterator}, or {@code defaultValue} if the
  iterator is empty.
  
  @throws IllegalArgumentException if the iterator contains multiple elements. The state of the
  iterator is unspecified.