Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Jenya Mia
Added: Mar 19, 2019 12:40 PM
Views: 24
Tags: list sorting
  1. Comparator<Inventory> comparator = Comparator.comparing(Inventory::getQty, Comparator.reverseOrder());
  2.  
  3. ...sorted(comparator).collect(Collectors.toList());