package dwarf;

import java.util.ArrayList;

public interface Child {

    public abstract Parent getParent();

    public abstract void setParent(Parent parent);

    public static ArrayList<Child> getSiblings(Child child) {
        return child.getParent().getChildren();
    }

    public static boolean hasSiblings(Child child) {
        return child.getParent().getChildren().size() > 1;
    }

    public static boolean hasParent(Child child) {
        try {
            child.getParent().getChildren();
            return true;
        } catch (NullPointerException npe) {
            return false;
        }
    }
}

@@ -38,16 +38,139 @@
 yList;%0A%0A
+/**%0A * Definition of anything that can have parent.%0A * %0A * @author Matthew 'siD' Van der Bijl%0A * %0A * @see dwarf.Parent%0A */%0A
 public i
@@ -507,32 +507,255 @@
 ze() %3E 1;%0A    %7D%0A
+    %0A   /**%0A    * returns true if the inputed %3Ccode%3EChild%3C/code%3E has a %3Ccode%3EParent%3C/code%3E otherwise false.%0A    *%0A    * @param parent the %3Ccode%3EChild%3C/code%3E to be tested%0A    * @return if the child a has parent or not%0A    */
 %0A    public stat

Update Child.java