-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMain.java
More file actions
40 lines (30 loc) · 918 Bytes
/
Main.java
File metadata and controls
40 lines (30 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package lamda.Example3.way2;
import java.util.List;
public class Main {
public static void main(String[] args) {
List<Person> pl = Person.createShortList();
RoboContactAnon robo = new RoboContactAnon();
System.out.println("\n==== Test 03 ====");
System.out.println("\n=== Calling all Drivers ===");
robo.phoneContacts(pl, new MyTest<Person>() {
@Override
public boolean test(Person p) {
return p.getAge() >= 16;
}
});
System.out.println("\n=== Emailing all Draftees ===");
robo.emailContacts(pl, new MyTest<Person>() {
@Override
public boolean test(Person p) {
return p.getAge() >= 18 && p.getAge() <= 25;
}
});
System.out.println("\n=== Mail all Pilots ===");
robo.mailContacts(pl, new MyTest<Person>() {
@Override
public boolean test(Person p) {
return p.getAge() >= 23 && p.getAge() <= 65;
}
});
}
}