package alx.p31_streamy.emps;

import java.util.Map;
import java.util.stream.Collectors;

public class Grupowanie2_CzystoStrumieniowo {

	public static void main(String[] args) {
		Map<String, Double> srednie = ObslugaCSV.wczytajStrumien("emps.csv")
				.collect(Collectors.groupingBy(Employee::getJobTitle,
						Collectors.averagingInt(Employee::getSalary)));
		
		srednie.forEach((job, avg) -> System.out.printf("%32s → %8.2f\n", job, avg));
	}

}
