Footnote { public boolean linksTo(Footnote otherFootnote) { return this.symbol.equals(otherFootnote.symbol); } Footnote();  Footnote(String symbol, int position); String getSymbol(); void setSymbol(String symbol); int getPosition(); void setPosition(int position); boolean linksTo(Footnote otherFootnote); @Override String toString(); String toHtml();  }
@Test public void testLinksTo() { Footnote footnote = new Footnote("*",1); Footnote footnoteSameSymbol = new Footnote("*",2); Footnote footnoteDifferentSymbol = new Footnote("$",1); assertTrue(footnote.linksTo(footnoteSameSymbol)); assertTrue(footnoteSameSymbol.linksTo(footnote)); assertFalse(footnote.linksTo(footnoteDifferentSymbol)); assertFalse(footnoteDifferentSymbol.linksTo(footnote)); }