public static void main(String... args) throws IOException {
        long start = System.nanoTime();
        lines = loadLines("output.json");

        Collections.sort(lines, new Comparator<String>() {
            @Override
            public int compare(String o1, String o2) {
                if (o1.length() > o2.length()) {
                    return 1;
                } else if (o1.length() < o2.length()) {
                    return -1;
                }
                return 0;
            }
        });

        generateFile("lines.txt");

        // save lines.
        long time = System.nanoTime() - start;

        System.out.printf("Took %.3f second to read, sort and write to a file%n", time / 1e9);
    }