/** Two relationships are assumed equal if they have the same source synset, target synset, and type */ public boolean equals(Object obj) { if (obj instanceof Relationship) { Relationship r = (Relationship) obj; return r.getType().equals(getType()) && r.getSourceSynset().equals(getSourceSynset()) && r.getTargetSynset().equals(getTargetSynset()); } return false; }