code: public static List<OrderByItem> getOrderByItems(JPQLExpression jpqlExpression)
      {
          List<OrderByItem> orderList = new LinkedList<>();
  
          if (hasOrderBy(jpqlExpression))
          {
              Expression orderByItems = getOrderByClause(jpqlExpression).getOrderByItems();
  
              if (orderByItems instanceof CollectionExpression)
              {
                  ListIterator<Expression> iterator = orderByItems.children().iterator();
                  while (iterator.hasNext())
                  {
                      OrderByItem orderByItem = (OrderByItem) iterator.next();
                      orderList.add(orderByItem);
                  }
              }
              else
              {
                  orderList.add((OrderByItem) orderByItems);
              }
          }
  
          return orderList;
      }
docs: Gets the order by items.
  
  @param jpqlExpression
  the jpql expression
  @return the order by items