class Generator<V> {
  /**
   * Generate the next value in the distribution.
   */
  public abstract V nextValue();

  /**
   * Return the previous value generated by the distribution; e.g., returned from the last {@link Generator#nextValue()}
   *  call.
   * Calling {@link #lastValue()} should not advance the distribution or have any side effects. If {@link #nextValue()}
   * has not yet been called, {@link #lastValue()} should return something reasonable.
   */
  public abstract V lastValue();

  public final String nextString() {
    V ret = nextValue();
    return ret == null ? null : ret.toString();
  }

  public final String lastString() {<FILL_FUNCTION_BODY>}
}

    V ret = lastValue();
    return ret == null ? null : ret.toString();
  
<no_super_class>