public List<Order> fetchOrders(int startIndex,int num){
  int endIndex=startIndex + num > orders.size() ? orders.size() : startIndex + num;
  return orders.subList(startIndex,endIndex);
}

public List < Order > fetchOrders ( int startIndex , int num ) { int endIndex = startIndex + num > orders . size ( ) ? orders . size ( ) : startIndex + num ; return orders . subList ( startIndex , endIndex ) ; }
returns a slice of orders
