@Override
    public T addChildToParent(T parent, T child) {
        if (child == null) {
            throw new IllegalArgumentException("Child shouldn't be null");
        }
        if (node.getData() != null && parent == null) {
            throw new IllegalArgumentException("Root already exists");
        }
        if (child.equals(parent)) {
            throw new IllegalArgumentException("Parent and child should be different");
        }
        T value = null;
        if (node.getData() == null) {
            node.setData(child);
            size++;
            return node.getData();
        }
        Node<T> parentNode = getNode(parent);
        if (parentNode != null) {
            Node<T> childNode = new Node<T>();
            childNode.setData(child);
            parentNode.getNodes().add(childNode);
            value = childNode.getData();
        }
        size++;
        return value;
    }