@Override public final boolean equals(Object o) { if (o == this) return true; if (!(o instanceof Occurrence)) return false; Occurrence t = (Occurrence) o; if (source != t.source) return false; if (pos != t.pos) return false; if (symbol == t.symbol) return true; else { if (symbol == null) return false; return symbol.equals(t); } }