Skip to content

Instantly share code, notes, and snippets.

@iyengarajay
Last active July 3, 2016 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iyengarajay/3312525dff9eae9d9eae63a7695554ba to your computer and use it in GitHub Desktop.
Save iyengarajay/3312525dff9eae9d9eae63a7695554ba to your computer and use it in GitHub Desktop.
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