At the beginning of my code, there is:
List> result = new ArrayList();
And then, (here is to reverse a sub-list):
It's because your result varible has a type of List, but your method want an ArrayList Try it with:
List result = new ArrayList<>();
or change your function in:
public List reverse(List list){...