function getURL(container, segments) {
  const locationImplementation = container.lookup('router:main').location;
  let url = [];
  for (let i = 0; i < segments.length; i++) {
    let name = null;

    if (typeof segments[i].generate !== 'function') {
      let { type, value } = segments[i];
      if (type === 1) {
        // dynamic
        name = `:${value}`;
      } else if (type === 2) {
        // star
        name = `*${value}`;
      } else {
        name = value;
      }
    }

    if (name) {
      url.push(name);
    }
  }

  url = url.join('/');

  if (url.match(/_unused_dummy_/)) {
    url = '';
  } else {
    url = `/${url}`;
    url = locationImplementation.formatURL(url);
  }

  return url;
}
@param {*} container
@param {*} segments
@return {String}