code: private void recordOrder(Order order, boolean isEntry) {
          if (order == null) {
              throw new IllegalArgumentException("Order should not be null");
          }
          
          // Storing the new order in entries/exits lists
          if (isEntry) {
              entryOrders.add(order);
          } else {
              exitOrders.add(order);
          }
          
          // Storing the new order in orders list
          orders.add(order);
          if (OrderType.BUY.equals(order.getType())) {
              // Storing the new order in buy orders list
              buyOrders.add(order);
          } else if (OrderType.SELL.equals(order.getType())) {
              // Storing the new order in sell orders list
              sellOrders.add(order);
          }
  
          // Storing the trade if closed
          if (currentTrade.isClosed()) {
              trades.add(currentTrade);
              currentTrade = new Trade(startingType);
          }
      }
docs: Records an order and the corresponding trade (if closed).
  @param order the order to be recorded
  @param isEntry true if the order is an entry, false otherwise (exit)