private void removeSelectorData(final ShenyuTrieNode currentNode, final String[] pathParts,
                                    final SelectorData selectorData, final List<?> collection) {
        List<SelectorData> selectorDataList = ListUtil.castList(collection, SelectorData.class::cast);
        synchronized (selectorData.getId()) {
            selectorDataList.removeIf(selector -> selector.getId().equals(selectorData.getId()));
        }
        currentNode.getPathCache().put(selectorData.getPluginName(), selectorDataList);
        if (CollectionUtils.isEmpty(selectorDataList) && Objects.isNull(currentNode.getChildren())
                && Objects.isNull(currentNode.getPathVariables())) {
            removeData(pathParts, selectorData.getPluginName());
        }
    }
remove selector data.

@param currentNode current node
@param pathParts path parts
@param selectorData selector data
@param collection selector data list
shenyu-plugin/shenyu-plugin-base/src/main/java/org/apache/shenyu/plugin/base/trie/ShenyuTrie.java