docs: public long cancel(long orderId, long quantity) {
      Order order = orders.get(orderId);
      if (order == null) {
        return 0;
      }
  
      OrderBook book = order.getOrderBook();
  
      long remainingQuantity = order.getRemainingQuantity();
  
      long canceledQuantity = Math.min(quantity, remainingQuantity);
  
      boolean bbo = book.update(order.getSide(), order.getPrice(), -canceledQuantity);
  
      if (canceledQuantity == remainingQuantity) {
        orders.remove(orderId);
      } else {
        order.reduce(canceledQuantity);
      }
  
      listener.update(book, bbo);
  
      return remainingQuantity - canceledQuantity;
    }