I am working on a problem that asks me to implement several functions for the given interfaces.

I have an interface that is a single node in a tree, and an interface that is the tree.

*TreeNode*: 

```
package main;

import java.util.List;

public interface TreeNode<E> {
    public E getElement();
    public void setElement(E elem);
    public void setChild(TreeNode<E> child);
    public TreeNode<E> getFirstChild();
    public List<TreeNode<E>> getChildren();
    public void setNextSibling(TreeNode<E> sibling);
    public TreeNode<E> getNextSibling();
    public int size();
    public int height();
    public List<TreeNode<E>> getPreOrder();
    public List<TreeNode<E>> getPostOrder();
    public String toString(TreeNode<E> node);
}

```

*Tree*:

```
package main;

import java.util.List;

public interface Tree<E> {
    public TreeNode<E> getRoot();
    public int size();
    public int height();
    public List<TreeNode<E>> getPreOrder();
    public List<TreeNode<E>> getPostOrder();
    public void makeEmpty();
    public boolean isEmpty();
    public int height(TreeNode<E> node);
    public int depth(TreeNode<E> node);
}

```

I am asked to: 

> 
> Implement these interfaces using the last-child/previous-sibling
>  method. Create MyTreeNode.java and MyTree.java that will extend Tree and TreeNode.
> 
> 
> 

*MyTreeNode.java* is defined as: 

> 
> An implementation that extends TreeNode.java.
> 
> 
> 

*MyTree.java* is defined as: 

> 
> An implementation that extends Tree.java.
> 
> 
> 

So I have begun to construct *MyTree.java*. The problem is, I do not know how to "**extend**" the interface and implement the methods. To me, it sounds like it want's me to **implement** the interfaces and construct the methods that were defined. As far as I know only an interface can extend another interface.

Another question is, how will I create many of these functions without proper left and right nodes? I believe that I am not allowed to modify the existing interfaces (*Tree.java*, and *TreeNode.java*).

Can anybody please help in explaining to me in layman's terms what I am supposed to be doing?