if (orderNumber >= orders.size()) { orders.add(order); } else { orders.set(orderNumber, order); }
orders.set(orderNumber, order);
    public void setOrder(int orderNumber, TrainOrdersModel order) {        if (orderNumber >= orders.size()) {            orders.add(order);        } else {            orders.set(orderNumber, order);        }    }