/** * Registers a operation callback. * * @param operationId the operation identifier * @param callback the operation callback * @throws NullPointerException if the {@code operationId} or {@code callback} is null */ default void register(OperationId operationId, Runnable callback) { checkNotNull(operationId, "operationId cannot be null"); checkNotNull(callback, "callback cannot be null"); handle(operationId, commit -> { callback.run(); return null; }); }