code: public static String joinPaths(List<String> paths) {
  
          String result = listAsString(paths, "/");
          // result may now contain multiple consecutive slashes, so reduce them to single slashes
          result = PATTERN_SLASHES.matcher(result).replaceAll("/");
          return result;
      }
docs: Concatenates multiple paths and separates them with '/'.<p>
  
  Consecutive slashes will be reduced to a single slash in the resulting string.
  For example, joinPaths("/foo/", "/bar", "baz") will return "/foo/bar/baz".
  
  @param paths the list of paths
  
  @return the joined path