### Question:
UniformDegreeDistribution implements DegreeDistribution { @Override public Sample createSample(final int size, final Random random) { final UniformRealDistribution distro = new UniformRealDistribution(0, size); distro.reseedRandomGenerator(random.nextLong()); return new Sample() { @Override public int getNextIndex() { return (int) distro.inverseCumulativeProbability(random.nextDouble()); } @Override public int getNextDegree() { return (int) distro.sample(); } }; }  @Override Sample createSample(final int size, final Random random);  }### Answer:
@Ignore @Test public void verifyDistributionsManuallyInR() throws IOException { Random random = new Random(); UniformDegreeDistribution distro = new UniformDegreeDistribution(); int n = 10000; DegreeDistribution.Sample sample = distro.createSample(n, random); DescriptiveStatistics stats = new DescriptiveStatistics(); writeTo(new File("/tmp/distro.csv"), ps -> { ps.println("degree"); for (int i = 0; i < n; i++) { double value = sample.getNextDegree(); ps.println(value); stats.addValue(value); } }); writeTo(new File("/tmp/distro-inv-cuml.csv"), ps -> { ps.println("index"); for (int i = 0; i < n; i++) { ps.println(sample.getNextIndex()); } }); }