class MutableAbsoluteProbabilityChooser {

    public void setProbability(T outcome, @Nonnegative double probability) {
        Preconditions.checkArgument(!outcome.equals(defaultOutcome), "Attempted to set the probability of the default result %s", defaultOutcome);
        Preconditions.checkArgument(probability >= 0, "Attempted to set probability for outcome %s to invalid value %s (must be >= 0)", outcome, probability);
        if (probability == 0) {
            outcomesToProbability.remove(outcome);
        } else {
            double newTotalProbability = outcomesToProbability.values().stream().reduce(0.0, Double::sum)
                    + probability
                    - outcomesToProbability.getOrDefault(outcome, 0.0);
            Preconditions.checkState(newTotalProbability <= 1 + ROUNDING_TOLERANCE, "Sum of probabilities for all outcomes has exceeded 1");
            outcomesToProbability.put(outcome, probability);
        }
    }

    public  MutableAbsoluteProbabilityChooser(T defaultOutcome);

}