forked from Agrasha-Janarthanan/MyJobs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFilterPerson.java
42 lines (32 loc) · 1.04 KB
/
FilterPerson.java
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
41
42
package com.ofs.training;
import java.util.ArrayList;
import java.util.function.Predicate;
import com.ofs.training.Person.Sex;
//class FilterPerson {
public class FilterPerson {
// public List checkAge() {
// ......
// }
//
// public List checkGender() {
// ......
// }
// static void execute() {
public static void main(String[] args) {
// List person = new List();
ArrayList<Person> people = new ArrayList<> ();
// List filteredPerson = person.checkAge();
// List nextFilteredPerson = filteredPerson.checkGender();
Predicate<Person> predicate = new Predicate<Person> () {
@Override
public boolean test(Person person) {
if ((person.getAge() > 21) && (person.getGender() == Sex.MALE)) {
return true;
}
return false;
}
// Console console = getConsole()...
// console.print(nextFilteredPerson);
System.out.println();
}
}