package emps.v3_funkcyjnie;

import java.util.Comparator;
import java.util.List;

public class F6_Sortowanie {

    public static void main(String[] args) {
        List<Employee> emps = ObslugaCSV.wczytajDane();
        
        // emps.parallelStream()
        emps.stream()
            .sorted(Comparator.comparingInt(Employee::getSalary).reversed())
            .forEachOrdered(emp -> System.out.printf("%s %s (%s) zarabia %d%n", emp.getFirstName(),
                                    emp.getLastName(), emp.getJobTitle(), emp.getSalary()));
    }

}
