class AcceptanceRateTracker implements ProposalListener {

    public double getAcceptanceRate(VariableReference variableReference) {
        if (!numApplied.keySet().contains(variableReference)) {
            throw new IllegalStateException("No proposals have been registered for " + variableReference);
        }
        return 1. - (double) numRejected.getOrDefault(variableReference, new Counter()).getValue() / numApplied.get(variableReference).getValue();
    }

}