How to get sublist from a list in Java [Practical Examples]