How do I sort a List of KeyValueEntity by a specific property?

I am using the following code to build a list:

ValueLoadContext context = ValueLoadContext.create()
		.setQuery(ValueLoadContext.createQuery(
				"select r.visit, r.costCenter, " +
						"COALESCE(sum(r.patientAmount), 0) " +
						"from kairosmd_VisitCharge r " +
						"where (r.visit.whoPays = 'P') " +
						"and (r.visit.guarantor = :guarantor) " +
						"and (r.visit.currency = :currency) " +
						"and (r.visit.patientBalanceAmount > 0) " +
						"group by r.visit, r.costCenter")
				.setParameter("guarantor", cheque.getGuarantor())
				.setParameter("currency", cheque.getCurrency())
		)
		.addProperty("visit")
		.addProperty("costCenter")
		.addProperty("chargeAmount");
List<KeyValueEntity> list = dataManager.loadValues(context);

Now that I have built a list stored in variable “list”, how do I sort the list by property “chargeAmount” ?

And how would I sort the list by multiple properties ?

Sorting a list by multiple properties - is a basic Java, not directly related to CUBA.
Example solutions for this task: java - Collections.sort with multiple fields - Stack Overflow