private void searchDeviceOverlapped(
      PathPatternNode<V, VSerializer> node, String[] deviceNodes, int pos, Set<V> resultSet) {
    if (pos == deviceNodes.length - 1) {
      resultSet.addAll(node.getValues());
      for (PathPatternNode<V, VSerializer> child : node.getChildren().values()) {
        resultSet.addAll(child.getValues());
      }
      return;
    }
    if (node.isMultiLevelWildcard()) {
      searchDeviceOverlapped(node, deviceNodes, pos + 1, resultSet);
    }
    for (PathPatternNode<V, VSerializer> child : node.getMatchChildren(deviceNodes[pos + 1])) {
      searchDeviceOverlapped(child, deviceNodes, pos + 1, resultSet);
    }
  }
Recursive method for search overlapped pattern for devicePath.

@param node current PathPatternNode
@param deviceNodes pathNodes of device
@param pos current index of deviceNodes
@param resultSet result set
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/PatternTreeMap.java