code: public SearchCriteria setOrders(
                      final List<? extends Order> orders
                      )
      {
          if (orders == getOrders()) {
              return this;
          }
  
          if (orders == null  ||  orders.size() == 0) {
              clearOrders();
              return this;
          }
  
          synchronized (orders) {
              for (Order  order : orders) {
                  if (order == null) {
                      throw new IllegalArgumentException( "null element" );
                  }
              }
  
              clearOrders();
              for (Order  order : orders) {
                  addOrder( order );
              }
          }
  
          return this;
      }
docs: Sets the specified ordering criteria to sort the result objects.
  
  <p>If the specified list is null or empty,
  it clears the previous list.
  If one of the element in the list is null,
  the previous list is not modified and an exception is thrown.
  </p>
  
  @param   orders
  the ordering criteria.
  @throws  IllegalArgumentException
  if an element in the specified list is null.