List<Object> list = new ArrayList<>();
int total = list.size();
int startIndex = (pageNo - 1) * pageSize;
if (startIndex> total){
startIndex=startIndex-1;
}
int endIndex = startIndex + pageSize;
if (endIndex > total) {
endIndex = total;
}
list=list.subList(startIndex,endIndex);
return list;