static String[] loadAndSort(Reader in) throws IOException {
        BufferedReader reader = new BufferedReader(in);
        ArrayList<String> lines = new ArrayList<>();
        String line;
        while ((line = reader.readLine()) != null) {

            if (line.isEmpty()) {
                line = "<empty";
            }
            lines.add(line);
        }
        reader.close();

        String[] array = lines.toArray(new String[lines.size()]);
        Arrays.sort(array);
        return array;
    }