CategoryGraph implements WikiConstants, Serializable { public double getDepth() throws WikiApiException { if (depth < 0) { if (rootPathMap != null) { this.depth = getDepthFromRootPathMap(); logger.info("Getting depth from RootPathMap: " + this.depth); } else { depth = computeDepth(); logger.info("Computing depth of the hierarchy: " + this.depth); } } return depth; } CategoryGraph();  CategoryGraph(Wikipedia pWiki, File location);  CategoryGraph(Wikipedia pWiki);  CategoryGraph(Wikipedia pWiki, List<String> filterList);  CategoryGraph(Wikipedia pWiki, Iterable<Category> categories);  CategoryGraph(Wikipedia pWiki, Iterable<Category> categories, List<String> filterList); protected  CategoryGraph(Wikipedia pWiki, Set<Integer> pPageIDs);  CategoryGraph(Wikipedia pWiki, DirectedGraph<Integer,DefaultEdge> pGraph); Category getLCS(Category category1, Category category2); int getLCSId(int categoryPageId1, int categoryPageId2); Category getLCS(int categoryPageId1, int categoryPageId2); int getPathLengthInEdges(Category node1, Category node2); int getTaxonomicallyBoundPathLengthInEdges(Category cat1, Category cat2); int getTaxonomicallyBoundPathLengthInNodes(Category cat1, Category cat2); int getPathLengthInNodes(Category node1, Category node2); double getIntrinsicInformationContent(Category category); void createRootPathMap(); void deleteRootPathMap(); CategoryGraph getLargestConnectedComponent(); int getNumberOfNodes(); int getNumberOfEdges(); double getAverageShortestPathLength(); double getDiameter(); double getAverageDegree(); double getClusterCoefficient(); Map<Integer, Integer> getDegreeDistribution(); double getDepth(); String getGraphInfo(); DirectedGraph<Integer, DefaultEdge> getGraph(); UndirectedGraph<Integer, DefaultEdge> getUndirectedGraph(); Map<Integer,Integer> getHyponymCountMap(); Map<Integer,List<Integer>> getRootPathMap(); void saveGraph(String destination);  }
@Test public void testDepth(){ try { double depth = catGraph.getDepth(); assertEquals(4, depth, 0.00001); } catch (WikiApiException e) { fail("Getting depth of the CategoryGraph throws exception."); } }