public class Accumulator<T> {
    private T value;

    public Accumulator(T initialValue) {
        value = initialValue;
    }

    public T incrementBy(T increment) {
        // this doesn't compile because the
        // += operator doesn't apply to type T
        return value += increment;
    }

    public T getValue() {
        return value;
    }
}