public ArrayList<Link> getParentsFromLink(ArrayList<Link> parents, Link link, Link parent) {
        if (this == link) {
            boolean found = false;
            for (Link link1 : parents) {
                if (parent == link1) {
                    found = true;
                }
            }
            if (!found) {
                parents.add(parent);
            }
        }
        for (Link currentLink : links) {
            currentLink.getParentsFromLink(parents, link, this);
        }
        return parents;
    }