class RollingAverage {

    public synchronized double put(final double value) {
        values[position % size] = value;
        position++;
        return average();
    }

    public  RollingAverage(final int size);

}