class UniformGenerator extends Generator<String> {
  private final List<String> values;
  private String laststring;
  private final UniformLongGenerator gen;

  /**
   * Creates a generator that will return strings from the specified set uniformly randomly.
   */
  public UniformGenerator(Collection<String> values) {
    this.values = new ArrayList<>(values);
    laststring = null;
    gen = new UniformLongGenerator(0, values.size() - 1);
  }

  /**
   * Generate the next string in the distribution.
   */
  @Override
  public String nextValue() {
    laststring = values.get(gen.nextValue().intValue());
    return laststring;
  }

  /**
   * Return the previous string generated by the distribution; e.g., returned from the last nextString() call.
   * Calling lastString() should not advance the distribution or have any side effects. If nextString() has not yet
   * been called, lastString() should return something reasonable.
   */
  @Override
  public String lastValue() {<FILL_FUNCTION_BODY>}
}

    if (laststring == null) {
      nextValue();
    }
    return laststring;
  
<methods>public non-sealed void <init>() ,public final java.lang.String lastString() ,public abstract java.lang.String lastValue() ,public final java.lang.String nextString() ,public abstract java.lang.String nextValue() <variables>