Are you iterating over a TreeSet or TreeMap? Oh wait - a TreeSet actually has a TreeMap inside it; that's probably why TreeMap appears in your stack trace. Hrmmm... TreeSet doesn't actually have a get() (which would've been my suggestion too if you were using a TreeMap).
Hmmm... I have a hard time offering advice here without a better understanding of what the code is trying to do. The Word class - do the equals() and compareTo() methods make use of the line count info? I suspect that what you really want/need here is a Map in which the keys are all String objects, and the values are either Integers (representing a total count) or some sort of List-type structure containing mulptiple word counts and any other info a Word needs to know. I can't really say more though without a better understanding of the problem.
The ConcurrentModificationException indicates that there's more than one
thread in your program, and they're modifying the TreeSet at the same time, without proper synchronization. You will need to study your code to see what other threads are doing, and then probably add some sort of synchronization to prevent the concurrent access. The simplest way to do this is probably to use Collections.synchronizedCollection() to get a synchronized view of the TreeSet. Be sure to read the API for this method, as it contains important info about how to synchronize while iterating. Note that there's a good chance this isn't really the best way to fix your code, just the simplest. Other solutions depend on how your code is organized ande what it's trying to do. I suggest studying the whole concept of threads and synchronization very carefully; a quick fix is rarely the correct solution.