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 ; } }
Get a sublist based on the restriction of limit and offset