public void invoke(Component component) {
        if (component instanceof Composite) {
            Component child = ((Composite) component).getChild(0);
        } else if (component instanceof Leaf) {
            throw new UnsupportedOperationException("不支持该操作");
        }
    }