Skip to content

Instantly share code, notes, and snippets.

@ohade
Last active May 12, 2019 09:12
Show Gist options
  • Save ohade/d63c2909d7d58d0fa7560cb38b3317a5 to your computer and use it in GitHub Desktop.
Save ohade/d63c2909d7d58d0fa7560cb38b3317a5 to your computer and use it in GitHub Desktop.
public class EntranceChecker {
private final Set<String> names;
public EntranceChecker(Set<String> names) {
this.names = names;
}
public boolean isInTheGuestList(Person person) {
if(person == null) {
return true;
}
return names.contains(person.getName());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment