returnString.append(" new Entity(");
returnString.append("\n\t\t new Entity(");
    public String parentschildrenArrayCreationString() {        // here's an example of the string this method should return:        //var parentschildren = new Array(new Entity("dogs","1",new Array(new Entity("poodle","4",null,false),new Entity("puli","5",null,true),new Entity("greyhound","5",null,false)),false), new Entity("fish","2",new Array(new Entity("trout","6",null,true),new Entity("mackerel","7",null,false),new Entity("bass","8",null,false)),true), new Entity("birds","3",new Array(new Entity("robin","9",null,false),new Entity("hummingbird","10",null,false),new Entity("crow","11",null,true)),false));        StringBuffer returnString = new StringBuffer(1000);        returnString.append("var parentschildren = new Array(");        int iCount = parentEntitiesList().count();        for (int i=0;i<iCount;i++) {            Object aParent = (Object)parentEntitiesList().objectAtIndex(i);            returnString.append("new Entity(");            returnString.append(" \"" + NSKeyValueCoding.Utility.valueForKey(aParent, parentDisplayValueName()) + "\",");            returnString.append(" \"" + aParent.hashCode() + "\",");            // now do all the possible children of the parent. Each child should look like 'new Entity("poodle","4",null,false)'            returnString.append(" new Array(");            NSArray childrenOfAParent = sortedChildren(aParent);            int jCount = childrenOfAParent.count();            Object defaultChild=defaultChildKey()!=null ? NSKeyValueCoding.Utility.valueForKey(aParent, defaultChildKey()) : null;            int defaultChildIndex=-1;            for (int j=0;j<jCount;j++) {                Object aChild = (Object)childrenOfAParent.objectAtIndex(j);                returnString.append(" new Entity(");                returnString.append(" \"" + NSKeyValueCoding.Utility.valueForKey(aChild, childDisplayValueName()) + "\","); // visible text of pop-up                returnString.append(" \"" + aChild.hashCode() + "\","); // value text of pop-up                returnString.append(" null,");                if (aChild.equals(selectedChild())) {                    returnString.append(" true");                } else {                    returnString.append(" false");                }                returnString.append(", null");                returnString.append(")");                if (j != jCount - 1) {                    // append a comma and a space                    returnString.append(", ");                }                if (aChild==defaultChild) defaultChildIndex=j;            }            returnString.append("),");            if (aParent.equals(selectedParent())) {                returnString.append(" true");            } else {                returnString.append(" false");            }            returnString.append(", ");            returnString.append(defaultChild!=null ? "\""+defaultChildIndex+"\"" : "0");            returnString.append(")");            if (i != iCount - 1) {                // append a comma and a space                returnString.append(", ");            }        }        returnString.append(");");        return returnString.toString();    }