PowerLawDegreeEdgePool extends AbstractPowerLawDegreeEdgePool { @Override public void addEdge(int nodeA, int nodeB) { int nextPoolForNodeA; if (nodeA >= readerAccessibleInfo.nodeDegrees.length) { expandArray(nodeA); nextPoolForNodeA = 0; } else { nextPoolForNodeA = getNextPoolForNode(nodeA); if (nextPoolForNodeA >= numPools) { addPool(); } } readerAccessibleInfo.edgePools[nextPoolForNodeA].addEdge(nodeA, nodeB); currentNumEdgesStored += 2; incrementNodeDegree(nodeA); currentNumEdgesStored--; numEdgesCounter.incr(); } PowerLawDegreeEdgePool(
      int expectedNumNodes,
      int expectedMaxDegree,
      double powerLawExponent,
      StatsReceiver statsReceiver); @Override void addEdge(int nodeA, int nodeB); @Override void addEdge(int nodeA, int nodeB, long metadata); @Override boolean hasEdgeMetadata();  }
@Test public void testExtremelySkewedGraph() { int maxNumNodes = 4; int maxDegree = 6; PowerLawDegreeEdgePool powerLawDegreeEdgePool = new PowerLawDegreeEdgePool(maxNumNodes, maxDegree, 2.0, new NullStatsReceiver()); int numEdgesToAdd = 100000; powerLawDegreeEdgePool.addEdge(0, 2); for (int i = 0; i < numEdgesToAdd; i++) { powerLawDegreeEdgePool.addEdge(1, i); } for (int i = 0; i < numEdgesToAdd; i++) { powerLawDegreeEdgePool.addEdge(2, i); } assertEquals(1, powerLawDegreeEdgePool.getNodeDegree(0)); assertEquals(numEdgesToAdd, powerLawDegreeEdgePool.getNodeDegree(1)); assertEquals(numEdgesToAdd, powerLawDegreeEdgePool.getNodeDegree(2)); }