// Select sorting direction
Comparator<Pair<Resource, Double>> comparator = smallest ?
(p1, p2) -> Double.compare(p1.second, p2.second) :
// Select sorting direction
Comparator<Pair<Resource, Double>> comparator = smallest ?
(p1, p2) -> Double.compare(p1.second, p2.second) :
// Get association list to property values
List<Pair<Resource, Double>> result2 = elements.stream()
// Get association list to property values
List<Pair<Resource, Double>> result2 = elements.stream()