Created
October 2, 2012 19:20
-
-
Save f0t0n/3822695 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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