code: protected List<String> joinUrls(List<String> l) {
      List<String> newList = new ArrayList<>();
      boolean inUrl = false;
      StringBuilder url = new StringBuilder();
      String urlQuote = null;
      for (int i = 0; i < l.size(); i++) {
        if (urlStartsAt(i, l)) {
          inUrl = true;
          if (i-1 >= 0) {
            urlQuote = l.get(i-1);
          }
          url.append(l.get(i));
        } else if (inUrl && urlEndsAt(i, l, urlQuote)) {
          inUrl = false;
          urlQuote = null;
          newList.add(url.toString());
          url.setLength(0);
          newList.add(l.get(i));
        } else if (inUrl) {
          url.append(l.get(i));
        } else {
          newList.add(l.get(i));
        }
      }
      if (url.length() > 0) {
        newList.add(url.toString());
      }
      return newList;
    }
docs: see rfc1738 and http://stackoverflow.com/questions/1856785/characters-allowed-in-a-url