code: public <T> T pick (Iterator<? extends T> iterator, T ifEmpty)
      {
          if (!iterator.hasNext()) {
              return ifEmpty;
          }
          T pick = iterator.next();
          for (int count = 2; iterator.hasNext(); count++) {
              T next = iterator.next();
              if (0 == _r.nextInt(count)) {
                  pick = next;
              }
          }
          return pick;
      }
docs: Pick a random element from the specified Iterator, or return <code>ifEmpty</code>
  if it is empty.
  
  <p><b>Implementation note:</b> because the total size of the Iterator is not known,
  the random number generator is queried after the second element and every element
  thereafter.
  
  @throws NullPointerException if the iterator is null.