// Java: int total = employees.stream() .collect(Collectors.summingInt(Employee::getSalary)));
// Kotlin: val total = employees.sumBy { it.salary }