docs: static TorrentMetadata create(File parent, List<File> files, URI announce,
                                  List<List<URI>> announceList, String createdBy, long creationTimeSecs, final int pieceSize)
            throws InterruptedException, IOException {
      Map<String, BEValue> torrent = new HashMap<String, BEValue>();
  
      if (announce != null) {
        torrent.put(ANNOUNCE, new BEValue(announce.toString()));
      }
      if (announceList != null) {
        List<BEValue> tiers = new LinkedList<BEValue>();
        for (List<URI> trackers : announceList) {
          List<BEValue> tierInfo = new LinkedList<BEValue>();
          for (URI trackerURI : trackers) {
            tierInfo.add(new BEValue(trackerURI.toString()));
          }
          tiers.add(new BEValue(tierInfo));
        }
        torrent.put(ANNOUNCE_LIST, new BEValue(tiers));
      }
      torrent.put(CREATION_DATE_SEC, new BEValue(creationTimeSecs));
      torrent.put(CREATED_BY, new BEValue(createdBy));
  
      Map<String, BEValue> info = new TreeMap<String, BEValue>();
      info.put(NAME, new BEValue(parent.getName()));
      info.put(PIECE_LENGTH, new BEValue(pieceSize));
  
      if (files == null || files.isEmpty()) {
        info.put(FILE_LENGTH, new BEValue(parent.length()));
        info.put(PIECES, new BEValue(hashFile(parent, pieceSize),
                Constants.BYTE_ENCODING));
      } else {
        List<BEValue> fileInfo = new LinkedList<BEValue>();
        for (File file : files) {
          Map<String, BEValue> fileMap = new HashMap<String, BEValue>();
          fileMap.put(FILE_LENGTH, new BEValue(file.length()));
  
          LinkedList<BEValue> filePath = new LinkedList<BEValue>();
          while (file != null) {
            if (file.equals(parent)) {
              break;
            }
  
            filePath.addFirst(new BEValue(file.getName()));
            file = file.getParentFile();
          }
  
          fileMap.put(FILE_PATH, new BEValue(filePath));
          fileInfo.add(new BEValue(fileMap));
        }
        info.put(FILES, new BEValue(fileInfo));
        info.put(PIECES, new BEValue(hashFiles(files, pieceSize),
                Constants.BYTE_ENCODING));
      }
      torrent.put(INFO_TABLE, new BEValue(info));
  
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      BEncoder.bencode(new BEValue(torrent), baos);
      return new TorrentParser().parse(baos.toByteArray());
    }