class Variance implements Writeable, Comparable<Variance> {

    private double sumOfSqrs;
    private double sum;
    private long count;

    public Variance() {
        sumOfSqrs = 0.0;
        sum = 0.0;
        count = 0;
    }

    public Variance(StreamInput in) throws IOException {
        sumOfSqrs = in.readDouble();
        sum = in.readDouble();
        count = in.readVLong();
    }

    @Override
    public void writeTo(StreamOutput out) throws IOException {
        out.writeDouble(sumOfSqrs);
        out.writeDouble(sum);
        out.writeVLong(count);
    }

    public void increment(double value) {
        sumOfSqrs += (value * value);
        sum += value;
        count++;
    }

    public void decrement(double value) {
        sumOfSqrs -= (value * value);
        sum -= value;
        count--;
    }

    public double result() {
        if (count == 0) {
            return Double.NaN;
        }
        return (sumOfSqrs - ((sum * sum) / count)) / count;
    }

    public void merge(Variance other) {<FILL_FUNCTION_BODY>}

    @Override
    public int compareTo(Variance o) {
        return Double.compare(result(), o.result());
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Variance variance = (Variance) o;
        return Objects.equals(variance.result(), result());
    }

    @Override
    public int hashCode() {
        return Objects.hash(result());
    }
}

        sumOfSqrs += other.sumOfSqrs;
        sum += other.sum;
        count += other.count;
    
<no_super_class>