You are given a class called, where different enums are added. For example
AGE --> BABY, TEEN, YOUNG_ADULT etc. (with constructor and getValue())
OCCULT --> FAIRY, WITCH, VAMPIRE etc. (with constructor and getValue())
You are given a Person class with
firstName, lastName, age (type is AGE enum), salary, occult (type is occult), getter methods of all of its properties
For data, you are given
public static final List People = List.of(
new Person("ABC", "DEF", Age.SENIOR, 200, Occult.WEREWOLF),
new Person("XYZ", "PQR", Age.BABY, 0, Occult.FAIRY),
...
);
You are given a FunctionalInterface like this
@FunctionalInterface
public interface PersonFilter {
boolean test(Person person);
}
Now create 3 filters with the help of functional programming in such a way that if anyone wants to use a filter by age, occult, salary, they can. Also, make sure to implement these filters in such a way that multiple filters with and, or conditions can be applied (probably want to use combinator pattern)