package com.seatgeek.sixpack;

public class PrefetchedExperiment {

    private final Sixpack sixpack;

    public final Experiment baseExperiment;

    public final Alternative selectedAlternative;

    public PrefetchedExperiment(final Sixpack sixpack, final Experiment experiment, final Alternative alternative) {
        this.sixpack = sixpack;
        baseExperiment = experiment;
        selectedAlternative = alternative;
    }

    public ParticipatingExperiment participate() {
        return sixpack.participate(baseExperiment);
    }

    @Override
    public boolean equals(final Object o) {
        if (this == o) return true;
        if (!(o instanceof PrefetchedExperiment)) return false;

        final PrefetchedExperiment that = (PrefetchedExperiment) o;

        if (baseExperiment != null ? !baseExperiment.equals(that.baseExperiment) : that.baseExperiment != null)
            return false;
        return !(selectedAlternative != null ? !selectedAlternative.equals(that.selectedAlternative) : that.selectedAlternative != null);
    }

    @Override
    public int hashCode() {
        int result = baseExperiment != null ? baseExperiment.hashCode() : 0;
        result = 31 * result + (selectedAlternative != null ? selectedAlternative.hashCode() : 0);
        return result;
    }
}

@@ -24,16 +24,234 @@
 xpack;%0A%0A
+/**%0A * Used after a call to %7B@link Experiment#prefetch()%7D as a cached selection. When the action under%0A * test starts, a call to %7B@link #participate()%7D should be made for the results to count against your%0A * test.%0A */%0A
 public c
@@ -643,24 +643,101 @@
 ive;%0A    %7D%0A%0A
+    /**%0A     * Turns this prefetched alternative into an active one.%0A     */%0A
     public P

Document the PrefetchedExperiment api.