I just came across this code that works
List> parentList = new ArrayList<>(); LinkedList curList = new LinkedLi