code: public Set<String> getInlinkAnchors(Page page)
  		throws WikiTitleParsingException
  	{
  		Set<String> inAnchors = new HashSet<String>();
  		for (Page p : page.getInlinks()) {
  			ParsedPage pp = parser.parse(p.getText());
  			if (pp == null) {
  				return inAnchors;
  			}
  			for (Link l : pp.getLinks()) {
  				String pageTitle = page.getTitle().getPlainTitle();
  
  				String anchorText = l.getText();
  				if (l.getTarget().equals(pageTitle) && !anchorText.equals(pageTitle)) {
  					inAnchors.add(anchorText);
  				}
  			}
  		}
  		return inAnchors;
  	}
docs: Note that this method only returns the anchors that are not equal to the page's title.
  Anchors might contain references to sections in an article in the form of "Page#Section".
  If you need the plain title, e.g. for checking whether the page exists in Wikipedia, the Title object can be used.
  
  @return A set of strings used as anchor texts in links pointing to that page.
  @throws WikiTitleParsingException