Page implements WikiConstants { public Set<Category> getCategories() { Session session = this.wiki.__getHibernateSession(); session.beginTransaction(); session.buildLockRequest(LockOptions.NONE).lock(hibernatePage); Set<Integer> tmp = new UnmodifiableArraySet<Integer>(hibernatePage.getCategories()); session.getTransaction().commit(); Set<Category> categories = new HashSet<Category>(); for (int pageID : tmp) { categories.add(wiki.getCategory(pageID)); } return categories; } protected  Page(Wikipedia wiki, long id); protected  Page(Wikipedia wiki, int pageID);  Page(Wikipedia wiki, String pName);  Page(Wikipedia wiki, String pName, boolean useExactTitle); protected  Page(Wikipedia wiki, long id,
			de.tudarmstadt.ukp.wikipedia.api.hibernate.Page hibernatePage); int getPageId(); Set<Category> getCategories(); int getNumberOfCategories(); Set<Page> getInlinks(); int getNumberOfInlinks(); Set<Integer> getInlinkIDs(); Set<Page> getOutlinks(); int getNumberOfOutlinks(); Set<Integer> getOutlinkIDs(); Title getTitle(); Set<String> getRedirects(); String getText(); boolean isDisambiguation(); boolean isRedirect(); boolean isDiscussion(); String getPlainText();  }
@Test public void testGetCategories() { Set<Category> categories = page.getCategories(); assertNotNull(categories); assertFalse(categories.isEmpty()); assertEquals(2, categories.size()); try { boolean foundSIR = false; boolean foundDisambiguation = false; for (Category c : categories) { String ct = c.getTitle().getPlainTitle(); assertNotNull(ct); if ("SIR".equals(ct)) { foundSIR = true; } if ("Disambiguation".equals(ct)) { foundDisambiguation = true; } } assertTrue(foundSIR); assertTrue(foundDisambiguation); } catch (WikiTitleParsingException e) { fail("A WikiTitleParsingException occurred while accessing the category title of the page: " + e.getLocalizedMessage()); } }