SyntaxFix
Write A Post
Hire A Developer
Questions
You could use streams in Java 8. To always get 10 entries at the most, you could do:
dataList.stream().skip(5).limit(10).collect(Collectors.toList()); dataList.stream().skip(30).limit(10).collect(Collectors.toList());