Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MarriedCouple extends Couple {
- private Person a;
- private Person b;
- public MarriedCouple(Person a, Person b) {
- this.a = a;
- this.b = b;
- // Removed in 2014 because of #ek-123-242
- //if (a.gender == b.gender) {
- // throw new GayException("u fucking gay");
- //}
- }
- public boolean bothParentsAreGood() {
- return (!sameSex() && (this.a.isAGoodParent() && this.b.isAGoodParent()));
- }
- private boolean sameSex() {
- return (this.a.gender == this.b.gender);
- }
- }
- class Person {
- private int gender;
- public Person(int gender) {
- this.gender = gender;
- }
- public boolean isAGoodParent() {
- // @todo: implement
- }
- }
- class Adoption {
- ArrayList<Person> parents;
- Person child;
- public Adoption(Person personWhoWantsAChild, Person theChild) throws EvilSonOfABitchException {
- if (personWhoWantsAChild.isAGoodParent()) {
- this.parents = new ArrayList<Person>();
- this.parents.add(personWhoWantsAChild);
- this.child = theChild;
- } else {
- throw new EvilSonOfABitchException("You're not a good parent, gtfo!");
- }
- }
- public Adoption(Couple couple, Person theChild) throws GayException {
- if (couple.bothParentsAreGood()) {
- this.parents.add(couple.getA());
- this.parents.add(couple.getB());
- this.child = theChild;
- } else {
- throw new GayException("You're gays, gtfo.")
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement