code: public static void main(String[] args) throws IOException {
          Profiles p = Profiles.read(new File(args[0]));
          if (args.length >= 2) {
              Map<Integer,Set<String>> lists = new TreeMap<Integer,Set<String>>();
              for (int i = 1; i <= 4; i++)
                  lists.put(i, new TreeSet<String>());
  
              File rt_jar_lst = new File(args[1]);
              for (String line: Files.readAllLines(rt_jar_lst.toPath(), Charset.defaultCharset())) {
                  if (line.endsWith(".class")) {
                      String type = line.substring(0, line.length() - 6);
                      int profile = p.getProfile(type);
                      for (int i = profile; i <= 4; i++)
                          lists.get(i).add(type);
                  }
              }
  
              for (int i = 1; i <= 4; i++) {
                  BufferedWriter out = new BufferedWriter(new FileWriter(i + ".txt"));
                  try {
                      for (String type: lists.get(i)) {
                          out.write(type);
                          out.newLine();
                      }
                  } finally {
                      out.close();
                  }
              }
          }
      }
docs: for debugging