public static String[] readAllLines() {
        ArrayList<String> lines = new ArrayList<String>();
        
        while (hasNextLine()) {
            lines.add(readLine());
        }
        return lines.toArray(new String[0]);
    }