Skip to content

Instantly share code, notes, and snippets.

Last active May 20, 2016
What would you like to do?
Version1: Get list of all men from a list of Person Objects
private static List<Person> getAllMen(List<Person> persons)
List<Person> men = new ArrayList<>();
for(Person person : persons)
if(person.getGender() == Gender.MALE)
return men;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment