static @Nullable String collapsePath(@Nullable String path, @Nullable PathMacroSubstitutor pathMacroSubstitutor) {
    if (pathMacroSubstitutor == null || path == null) return path;
    return pathMacroSubstitutor.collapsePath(path);
  }
static @Nullable String collapsePath(@Nullable String path, @Nullable PathMacroSubstitutor pathMacroSubstitutor)