code: private void iterateCategoriesGetArticles(Wikipedia pWiki, CategoryGraph catGraph) throws WikiPageNotFoundException {
          Map<Integer,Integer> localDegreeDistribution = new HashMap<Integer,Integer>();
          Set<Integer> localCategorizedArticleSet = new HashSet<Integer>();
          Set<Integer> categoryNodes = catGraph.getGraph().vertexSet();
          // iterate over all categories
          int progress = 0;
          for (int node : categoryNodes) {
              progress++;
              ApiUtilities.printProgressInfo(progress, categoryNodes.size(), 100, ApiUtilities.ProgressInfoMode.TEXT, "iterate over categories");
  
              // get the category
              Category cat = pWiki.getCategory(node);
              if (cat != null) {
                  Set<Integer> pages = new HashSet<Integer>(cat.__getPages());
  
                  // update degree distribution map
                  int numberOfArticles = pages.size();
                  if (localDegreeDistribution.containsKey(numberOfArticles)) {
                      int count = localDegreeDistribution.get(numberOfArticles);
                      count++;
                      localDegreeDistribution.put(numberOfArticles, count);
                  }
                  else {
                      localDegreeDistribution.put(numberOfArticles, 1);
                  }
  
                  // add the page to the categorized articles set, if it is to already in it
                  for (int page : pages) {
                      if (!localCategorizedArticleSet.contains(page)) {
                          localCategorizedArticleSet.add(page);
                      }
                  }
              }
              else {
                  logger.info("{} is not a category.", node);
              }
          }
          this.degreeDistribution = localDegreeDistribution;
          this.categorizedArticleSet = localCategorizedArticleSet;
      }
docs: Methods computing stuff that have to iterate over all categories and access category articles can plug-in here.
  Recently plugin-in:
  numberOfCategorizedArticles
  distributionOfArticlesByCategory
  @param pWiki The wikipedia object.
  @param catGraph The category graph.
  @throws WikiPageNotFoundException