ListuniqueMStudentList = studentList.stream().collect( Collectors.collectingAndThen( Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(Student::name))), ArrayList::new) );

ListuniqueMStudentList = studentList.stream().collect( Collectors.collectingAndThen( Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(Student::name))), ArrayList::new) );