class MetadataGraph {
    /** all graph nodes */
    Collection<MetadataGraphNode> nodes;

    /** entry point for tree-like structures */
    MetadataGraphNode entry;

    public MetadataGraph(MetadataGraphNode entry) {
        this();

        this.entry = entry;
    }

    public MetadataGraph() {
        nodes = new ArrayList<>(64);
    }

    public void addNode(MetadataGraphNode node) {
        nodes.add(node);
    }

    /**
     * find a node by the GAV (metadata)
     *
     * @param md
     */
    public MetadataGraphNode findNode(MavenArtifactMetadata md) {<FILL_FUNCTION_BODY>}

    /**
     * getter
     */
    public MetadataGraphNode getEntry() {
        return entry;
    }

    /**
     * getter
     */
    public Collection<MetadataGraphNode> getNodes() {
        return nodes;
    }
}

        for (MetadataGraphNode mgn : nodes) {
            if (mgn.metadata.equals(md)) {
                return mgn;
            }
        }

        MetadataGraphNode node = new MetadataGraphNode(md);
        addNode(node);
        return node;
    
<no_super_class>