public int compareTo(Object o) { Speaker otherSpeaker = (Speaker) o; if (otherSpeaker.name().equals(name)) { this.occurrance += otherSpeaker.occurrance(); otherSpeaker.occurrance = this.occurrance; return 0; } return name.compareTo(otherSpeaker.name()); }