### Question:
GraphStatistics { public static Map<String, Object> degreeDistribution(Graph graph) { int batchSize = Math.toIntExact(ParallelUtil.adjustedBatchSize( graph.nodeCount(), ConcurrencyConfig.DEFAULT_CONCURRENCY, ParallelUtil.DEFAULT_BATCH_SIZE )); long maximumDegree = Math.max(2, graph.relationshipCount()); AtomicHistogram histogram = new AtomicHistogram(maximumDegree, PRECISION); ParallelUtil.readParallel( ConcurrencyConfig.DEFAULT_CONCURRENCY, batchSize, graph, Pools.DEFAULT, (nodeOffset, nodeIds) -> () -> { PrimitiveLongIterator iterator = nodeIds.iterator(); while (iterator.hasNext()) { long nodeId = iterator.next(); int degree = graph.degree(nodeId); histogram.recordValue(degree); } } ); return MapUtil.map( "min", histogram.getMinValue(), "mean", histogram.getMean(), "max", histogram.getMaxValue(), "p50", histogram.getValueAtPercentile(50), "p75", histogram.getValueAtPercentile(75), "p90", histogram.getValueAtPercentile(90), "p95", histogram.getValueAtPercentile(95), "p99", histogram.getValueAtPercentile(99), "p999", histogram.getValueAtPercentile(99.9) ); } private  GraphStatistics(); static Map<String, Object> degreeDistribution(Graph graph); static double density(long nodeCount, long relationshipCount); static double density(Graph graph);  }### Answer:
@Test void degreeDistribution() { var actual = GraphStatistics.degreeDistribution(graph); var expected = Map.of( "min", 0L, "max", 3L, "mean", 1.5D, "p50", 1L, "p75", 2L, "p90", 3L, "p95", 3L, "p99", 3L, "p999", 3L ); assertThat(actual).containsExactlyInAnyOrderEntriesOf(expected); }