CompleteGraphRelationshipGenerator extends BaseRelationshipGenerator<NumberOfNodesBasedConfig> { @Override protected List<Pair<Integer, Integer>> doGenerateEdges() { List<Pair<Integer, Integer>> graph = new ArrayList<>(); for (int i = 0; i < getConfiguration().getNumberOfNodes(); i++) { for (int j = i + 1; j < getConfiguration().getNumberOfNodes(); j++) { graph.add(Pair.of(i, j)); } } return graph; } CompleteGraphRelationshipGenerator(NumberOfNodesBasedConfig configuration);   }
@Test public void testCompleteGraphGenerator() { int numberOfNodes = 6; NumberOfNodesBasedConfig num = new NumberOfNodesBasedConfig(numberOfNodes); CompleteGraphRelationshipGenerator cg = new CompleteGraphRelationshipGenerator(num); List<Pair<Integer, Integer>> edges = cg.doGenerateEdges(); assertIsComplete(edges, numberOfNodes); }