@Override
    public int getIndex(TreeNode node) {
        if (!(node instanceof MyFile)) {
            throw new IllegalArgumentException("Unsupported type for the tree node " + node);
        }
        return this.files.indexOf(node);
    }