### Question:
QueryModifiers implements Serializable { 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; } } private  QueryModifiers();  QueryModifiers(@Nullable Long limit, @Nullable Long offset);  QueryModifiers(QueryModifiers modifiers); static QueryModifiers limit(@Nonnegative long limit); static QueryModifiers offset(@Nonnegative long offset); @Nullable Long getLimit(); @Nullable Integer getLimitAsInteger(); @Nullable Long getOffset(); @Nullable Integer getOffsetAsInteger(); boolean isRestricting(); List<T> subList(List<T> list); @Override boolean equals(Object o); @Override int hashCode(); static final QueryModifiers EMPTY; }### Answer:
@Test public void subList() { List<Integer> ints = Arrays.asList(1,2,3,4,5); assertEquals(Arrays.asList(3,4,5), QueryModifiers.offset(2).subList(ints)); assertEquals(Arrays.asList(1,2,3), QueryModifiers.limit(3).subList(ints)); assertEquals(Arrays.asList(2,3,4), new QueryModifiers(3L, 1L).subList(ints)); }