### Question:
GraphStatistics { public static double density(long nodeCount, long relationshipCount) { return (nodeCount > 0L) ? (double) relationshipCount / (nodeCount * (nodeCount - 1)) : 0; } private  GraphStatistics(); static Map<String, Object> degreeDistribution(Graph graph); static double density(long nodeCount, long relationshipCount); static double density(Graph graph);  }### Answer:
@Test void graphBasedDensity() { assertEquals(GraphStatistics.density(graph), 0.5); }