code: public static MultivaluedMap<String, String> decodeMatrix(String pathSegment, boolean decode) {
          // EMODB-MODIFICATION Replaced with EmoMultivaluedMap implementation
          MultivaluedMap<String, String> matrixMap = EmoMultivaluedMap.create();
  
          // Skip over path segment
          int s = pathSegment.indexOf(';') + 1;
          if (s == 0 || s == pathSegment.length()) {
              return matrixMap;
          }
  
          do {
              int e = pathSegment.indexOf(';', s);
  
              if (e == -1) {
                  decodeMatrixParam(matrixMap, pathSegment.substring(s), decode);
              } else if (e > s) {
                  decodeMatrixParam(matrixMap, pathSegment.substring(s, e), decode);
              }
              s = e + 1;
          } while (s > 0 && s < pathSegment.length());
  
          return matrixMap;
      }
docs: Decode the matrix component of a URI path segment.
  
  @param pathSegment the path segment component in encoded form.
  @param decode      true if the matrix parameters of the path segment component
  should be in decoded form.
  @return the multivalued map of matrix parameters.