public static PropagateBlacklist initialPropagation(
     SerializedMultiFile<int[]> from, SerializedMultiFile<int[]> to) throws Exception {
   PropagateBlacklist pb = new PropagateBlacklist();
   for (int i = 0; i < from.getPartitionFunction().getPartitionCount(); i++) {
     IntList fromList = new IntArrayList(from.readFirstObject(i));
     IntList toList = new IntArrayList(to.readFirstObject(i));
     pb.process(fromList, toList);
   }
   return pb;
 }
  public static void main(String[] args) throws Exception {
    blacklist = loadCreation(PartitionsAndFiles.getBlackList());
    whitelist = loadCreation(PartitionsAndFiles.getWhiteList());

    System.out.println("Read lists: wl: " + whitelist.size() + " bl:" + blacklist.size());

    PropagateBlacklist pb =
        initialPropagation(PartitionsAndFiles.getLinkFrom(), PartitionsAndFiles.getLinkTo());

    int pass = 1;
    logger.info(
        "Pass:"******" wl: "
            + whitelist.size()
            + " bl:"
            + blacklist.size()
            + " remaining links:"
            + pb.linkFrom.size());
    while (pb.blacklisted > 0) {
      pass++;
      PropagateBlacklist oldPb = pb;
      pb = new PropagateBlacklist();
      pb.process(pb.linkFrom, pb.linkTo);
      logger.info(
          "Pass:"******" wl: "
              + whitelist.size()
              + " bl:"
              + blacklist.size()
              + " remaining links:"
              + pb.linkFrom.size());
    }

    new FileOpener()
        .writeObject(PartitionsAndFiles.getExpandedBlackListFile(), blacklist.toIntArray());
  }