List<Person> sortMassPerson = characters.stream() .sorted(Comparator.comparingInt(Person::getMass).reversed()) .collect(Collectors.toList()); sortMassPerson.forEach(Person::info);
Last updated 2 years ago
Was this helpful?