A simple yet powerful console-based toolkit for filtering and grouping people data based on age, sex, and nationality.
- Filter people who can drink alcohol in Germany (age 16+)
- Filter people who can drink alcohol in USA (age 21+)
- Filter people who can drink alcohol in Afghanistan (age 14+, male only)
- Each filter returns a new array with only the matching people
- Filter people who can freely speak English
- Includes citizens of USA and Canada
- Group by passport strength — Afghanistan goes under WEAK, USA, Canada and Germany go under STRONG
- Group by sex — splits people into MALE and FEMALE lists
- Group by age — calculates average age and splits into YOUNG (below average) and OLD (above average)
- Count English speakers — returns a map with true (USA & Canada, age 4+) and false (everyone else)
- Print any people dataset directly to the console
- Universal
printMap()method works with any grouped result
- Enums for type-safe data (Sex, Nationality, PassportStrength, Adulthood)
- Arrays vs ArrayList — when and why to use each
- HashMap as a key-value data structure for grouping
- DRY principle — reusable methods instead of repeated code
- Single Responsibility — each class has one clear purpose
- Autoboxing — difference between
intandInteger,booleanandBoolean
- Clone the repository
- Open in IntelliJ IDEA
- Run
Main.java