17.6.1 Creating and Displaying a List<Employee>
Class ProcessingEmployees (Figs. 17.10–17.16) is split into several figures so we can show you the lambda and streams operations with their corresponding outputs. Figure 17.10 creates an array of Employees (lines 17–24) and gets its List view (line 27).
Click here to view code image
1 // Fig. 17.10: ProcessingEmployees.java 2 // Processing streams of Employee objects. 3 import java.util.Arrays; 4 import java.util.Comparator; 5 import java.util.List; 6 import java.util.Map; 7 import java.util.TreeMap; 8 import java.util.function.Function; 9 import java.util.function.Predicate;10 import java.util.stream.Collectors; 11
12 public class ProcessingEmployees ...