if ((prev != null) && (!prev.equals(word))) {
if (prev == null || !prev.equals(word)) {
    private File buildSortedFile() throws FileNotFoundException, IOException {        List w = new ArrayList();        /*         * read every single word into the list. eeek. if this causes problems,         * we may wish to explore disk-based sorting or more efficient memory-based storage         */        File[] wordFiles = words.listFiles();        for (int i = 0; i < wordFiles.length; i++) {            BufferedReader r = new BufferedReader(new FileReader(wordFiles[i]));            String word;            while ((word = r.readLine()) != null) {                if (!word.equals("")) {                    w.add(word.trim());                }            }            r.close();        }        Collections.sort(w);        // FIXME - error handling for running out of disk space would be nice.        File file = File.createTempFile("jazzy", "sorted");        BufferedWriter writer = new BufferedWriter(new FileWriter(file));        String prev = null;        for (int i = 0; i < w.size(); i++) {            String word = (String) w.get(i);            if ((prev != null) && (!prev.equals(word))) {                writer.write(word);                writer.newLine();            }            prev = word;        }        writer.close();        return file;    }