Java - Guava API to sort items in collection with Ordering compound example

less than 1 minute read

1
2
3
Collection.sort(list,
	Ordering.from((Comparator<Item>) Comparator.comparingInt(item -> item.getId()))
	.compound(Comparator.comparing(Item::getName)))