List<Movie> movies =Arrays.asList(newMovie("Lord of the rings",8.8),newMovie("Back to the future",8.5),newMovie("Carlito's way",7.9),newMovie("Pulp fiction",8.9));movies.sort(Comparator.comparingDouble(Movie::getRating).reversed());movies.forEach(System.out::println);