Category implements WikiConstants { public int getNumberOfPages() { BigInteger nrOfPages = new BigInteger("0"); long id = this.__getId(); Session session = this.wiki.__getHibernateSession(); session.beginTransaction(); Object returnValue = session.createNativeQuery("select count(pages) from category_pages where id = :id") .setParameter("id", id, LongType.INSTANCE) .uniqueResult(); session.getTransaction().commit(); if (returnValue != null) { nrOfPages = (BigInteger) returnValue; } return nrOfPages.intValue(); } protected  Category(Wikipedia wiki, long id); protected  Category(Wikipedia wiki, int pageID);  Category(Wikipedia wiki, String pName); int getPageId(); Set<Category> getParents(); int getNumberOfParents(); Set<Integer> getParentIDs(); Set<Category> getChildren(); int getNumberOfChildren(); Set<Integer> getChildrenIDs(); Title getTitle(); Set<Page> getArticles(); Set<Integer> getArticleIds(); int getNumberOfPages(); Iterable <Category> getDescendants(); Set<Category> getSiblings();  }
@Test public void testNumberOfCategoryPages(){ Category cat; try { cat = wiki.getCategory("UKP"); assertNotNull(cat); int numberOfPages = cat.getNumberOfPages(); assertTrue(numberOfPages > 0); assertEquals(2, numberOfPages); } catch (WikiApiException e) { fail("A WikiApiException occurred while getting the category 'People of UKP': " + e.getLocalizedMessage()); } }