private static String[] readTokens() throws IOException {
        Set<String> result = new TreeSet<String>();
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String t;
        while (true) {
            System.out.print("Enter token or blank line to end input: ");
            t = reader.readLine();
            if (t == null || (t = t.trim()).isEmpty()) {
                break;
            }
            result.add(t);
        }
        return result.toArray(new String[result.size()]);
    }