Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
private List<Person> getAllPersonByGenderAndCitizenhip(List<Person> persons, Gender gender, Citizenship citizenship)
{
List<Person> people = new ArrayList<>();
for(Person person : persons)
{
if(person.getGender() == gender && person.getCitizenship() == citizenship)
{
people.add(person);
}
}
return people;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment