private boolean isLocked(Order order){
  lock.lock();
  try {
    return activeOrders.contains(order.getId());
  }
  finally {
    lock.unlock();
  }
}

private boolean isLocked ( Order order ) { lock . lock ( ) ; try { return activeOrders . contains ( order . getId ( ) ) ; } finally { lock . unlock ( ) ; } }
determines if the order is locked .
