Skip to content

Instantly share code, notes, and snippets.

@iyengarajay
Last active Jul 3, 2016
Embed
What would you like to do?
private static List<Person> getAllMenUSA(List<Person> persons)
{
List<Person> menUSA = new ArrayList<>();
for(Person person : persons)
{
if(person.getGender() == Gender.MALE && person.getCitizenship() == Citizenship.USA)
{
menUSA.add(person);
}
}
return menUSA;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment