Skip to content

Instantly share code, notes, and snippets.

@f0t0n
Created October 2, 2012 19:20
Show Gist options
  • Save f0t0n/3822695 to your computer and use it in GitHub Desktop.
Save f0t0n/3822695 to your computer and use it in GitHub Desktop.
class Family {
Man husband;
Woman wife;
ChildrenCollection babies;
public Family(Man husband, Woman wife) {
this.husband = husband;
this.wife = wife;
}
public void makeBaby() throws GenderNotSupportedException {
if(husband.getGender() == wife.getGender()) {
throw GenderNotSupportedException(
"Operation is not permitted for gays and lesbians.");
}
Child baby = new Baby(husband, wife);
babies.add(baby);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment