static Path of(final String path) {
		final List<Param> params = new ArrayList<>();
		final var parsed = new StringBuilder();

		var normalizedPath = java.nio.file.Path.of(path)
			.normalize()
			.toString();
		if (!normalizedPath.startsWith("/")) {
			normalizedPath = "/" + normalizedPath;
		}

		final Matcher matcher = PARAM_PATTERN.matcher(normalizedPath);

		while (matcher.find()) {
			final var group = matcher.group();
			final String name = group.substring(1, group.length() - 1);
			matcher.appendReplacement(parsed, "?");
			final int index = parsed.length();
			params.add(new Param(index, name));
		}
		matcher.appendTail(parsed);

		final var invalid = params.stream()
			.map(p -> p.name)
			.filter(not(Path::isIdentifier))
			.toList();

		if (!invalid.isEmpty()) {
			throw new IllegalArgumentException(format(
				"Found invalid parameter names: %s", invalid
			));
		}

		return new Path(parsed.toString(), params);
	}
Create a new Path object from the given path string.

@param path the path string to parse.
@return the newly created {@code Path} object
@throws NullPointerException if the given SQL string is {@code null}
@throws IllegalArgumentException if one of the parameter names is not a
        valid Java identifier
jenetics.incubator/src/main/java/io/jenetics/incubator/restful/Path.java