public List<PartialPath> alterPrefixPath(PartialPath prefix) {
    Validate.notNull(prefix);

    // Make sure the prefix path doesn't contain any wildcard.
    for (String node : prefix.getNodes()) {
      if (MULTI_LEVEL_PATH_WILDCARD.equals(node) || ONE_LEVEL_PATH_WILDCARD.equals(node)) {
        throw new IllegalArgumentException(
            "Wildcards are not allowed in the prefix path: " + prefix.getFullPath());
      }
    }

    List<List<String>> results = new ArrayList<>();
    alterPrefixPathInternal(
        Arrays.asList(prefix.getNodes()), Arrays.asList(nodes), new ArrayList<>(), results);
    return results.stream()
        .map(r -> createPartialPath(r.toArray(new String[0])))
        .collect(Collectors.toList());
  }
Return the intersection of paths starting with the given prefix and paths matching this path
pattern.

<p>For example, minimizing "root.**.b.c" with prefix "root.a.b" produces "root.a.b.c",
"root.a.b.b.c", "root.a.b.**.b.c", since the multi-level wildcard can match 'a', 'a.b', and any
other sub paths start with 'a.b'.

<p>The goal of this method is to reduce the search space when querying a database with a path
with wildcard.

<p>If this path or path pattern doesn't start with given prefix, return empty list. For
example, "root.a.b.c".alterPrefixPath("root.b") or "root.a.**".alterPrefixPath("root.b")
returns [].

@param prefix The prefix. Cannot be null and cannot contain any wildcard.
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/PartialPath.java