private void update(int id, AtomicBoolean cancelled, Runnable operation) {
    update(id, operation, () -> cancelled.set(true));
  }
private void update(int id, AtomicBoolean cancelled, Runnable operation)