importjava.util.*;importjava.lang.*;importjava.util.stream.Stream;classRextester{publicstaticvoidmain(Stringargs[]){System.out.println("Hello, World!");Comparator<Employee>sortByName=newComparator<Employee>(){@Overridepublicintcompare(Employeee1,Employeee2){returne1.getName().compareTo(e2.getName());}};Employeeemp1=newEmployee(1,"Hatim",12.12);Employeeemp2=newEmployee(2,"El Ab",14.14);intcompareResult=sortByName.compare(emp1,emp2);System.out.println(compareResult);System.out.println("H".compareTo("E"));// define an interface reference and assign a lambda method instead of implementing the abstract method, // then call the method by its name as defined in the interface Comparator<Employee>sortByNameLambda=((Employeee1,Employeee2)->e1.getName().compareTo(e2.getName()));// here the call of the method compare of the interface Comparator<Employee>compareResult=sortByNameLambda.compare(emp1,emp2);System.out.println(compareResult);// Initial dataArrayList<Employee>list=newArrayList<Employee>();list.add(newEmployee(500,"Shifoo",150000));list.add(newEmployee(504,"Oogway",120000));list.add(newEmployee(503,"Tigress",100000));list.add(newEmployee(730,"Mantis",45000));System.out.println("Initial List :");list.forEach(System.out::println);// Static sort method of the Collections class Collections.sort(list,sortByName);System.out.println("\nStandard Sorted by Name :");list.forEach(System.out::println);list.sort(sortByNameLambda);System.out.println("\nLambda Sorted by Name :");list.forEach(System.out::println);System.out.println("\n#### Streams ####");String[]str_array=newString[]{"P","A","V"};//java.util.stream.StreamStream<String>str_stream=Arrays.stream(str_array);str_stream.forEach(elem->System.out.println(elem));List<String>str_list=Arrays.asList("AAA","BBB","CCC","USW...");str_stream=str_list.stream();str_stream.forEach(System.out::println);}}classEmployee{privateintid;privateStringname;privatedoublesalary;publicEmployee(intid,Stringname,doublesalary){this.id=id;this.name=name;this.salary=salary;}//Getters & SetterspublicStringgetName(){returnthis.name;}publicStringtoString(){returnthis.getName();}}