class OperationBatcher {

    public void operate() {
        if (closed) {
            throw new IllegalStateException("Batcher closed");
        }
        if (++count < batchSize) {
            return;
        }
        operation();
        reset();
        count = 0;
    }

    public  OperationBatcher(int batchSize);

}