@Test public void record_stats_information_from_simple_vertices() { VertexStatsRecorder recorder = new VertexStatsRecorder(); Vertex simple = VertexFactory.makeSimpleVertex(); Vertex simple2 = VertexFactory.makeSimpleVertex(); Vertex simple3 = VertexFactory.makeSimpleVertex(); Vertex simple4 = VertexFactory.makeSimpleVertex(); simple.addNeighbour(simple2).addNeighbour(simple3).addNeighbour(simple4); simple2.addNeighbour(simple3).addNeighbour(simple4); simple3.addNeighbour(simple4); simple.publishYourStatsOn(recorder); simple2.publishYourStatsOn(recorder); simple3.publishYourStatsOn(recorder); simple4.publishYourStatsOn(recorder); Map<PlainTextStatsComponents, Integer> expected = new HashMap<PlainTextStatsComponents, Integer>(); expected.put(PlainTextStatsComponents.NOfVertices, 4); expected.put(PlainTextStatsComponents.NOfEdges, 6); expected.put(PlainTextStatsComponents.NOfSources, 1); expected.put(PlainTextStatsComponents.NOfSinks, 1); expected.put(PlainTextStatsComponents.NOfWhites, 2); Assert.assertTrue(recorder.isSimpleVerticesVotesEquals(expected)); Assert.assertFalse( recorder.isSimpleVerticesVotesEquals(new HashMap<PlainTextStatsComponents, Integer>())); }