code: public <T> List<T> subList(List<T> list) {
          if (!list.isEmpty()) {
              int from = offset != null ? toInt(offset) : 0;
              int to = limit != null ? (from + toInt(limit)) : list.size();
              return list.subList(from, Math.min(to,list.size()));
          } else {
              return list;
          }
      }
docs: Get a sublist based on the restriction of limit and offset
  
  @param <T>
  @param list list to be handled
  @return sublist with limit and offset applied