Mention { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Mention other = (Mention) obj; if (annotation == null) { if (other.annotation != null) { return false; } } else if (!annotation.equals(other.annotation)) { return false; } return true; } private  Mention(Base annotation, MentionType type);  Mention(WordToken annotation);  Mention(Entity annotation);  Mention(PhraseChunk annotation); Base getAnnotation(); MentionType getType(); Set<Cluster> getClusters(); boolean hasClusters(); Cluster getAnyCluster(); void addToCluster(Cluster cluster); void clearClusters(); String getText(); void setHeadWordToken(WordToken headWordToken); WordToken getHeadWordToken(); String getHead(); boolean isAcronym(); void setAcronym(Set<String> acronyms); Set<String> getAcronyms(); boolean overlaps(Mention mention); @Override String toString(); void setMultiplicity(Multiplicity multiplicity); Multiplicity getMultiplicity(); void setWords(List<WordToken> words); List<WordToken> getWords(); void setPerson(Person person); Person getPerson(); void setAnimacy(Animacy animacy); Animacy getAnimacy(); Gender getGender(); void setGender(Gender gender); void setSentenceIndex(int index); int getSentenceIndex(); void setSentence(Sentence sentence); Sentence getSentence(); @Override int hashCode(); @Override boolean equals(Object obj); boolean isAttributeCompatible(Mention b);  }
@Test public void testEquals() { jCas.setDocumentText("Mary had a little lamb."); Entity e1 = new Entity(jCas, 0, 4); Entity e2 = new Entity(jCas, 11, 22); Mention m1 = new Mention(e1); Mention m1a = new Mention(e1); Mention m2 = new Mention(e2); assertEquals(m1, m1); assertEquals(m1, m1a); assertNotEquals(m1, null); assertNotEquals(m1, "Mary"); assertNotEquals(m1, m2); }