public void testStarGraphBetweenness() {
GraphModel graphModel = GraphGenerator.generateStarUndirectedGraph(5);
GraphDistance d = new GraphDistance();
d.initializeStartValues();
UndirectedGraph undirectedGraph = graphModel.getUndirectedGraph();
HashMap<Node, Integer> indicies = d.createIndiciesMap(undirectedGraph);
HashMap<String, double[]> metricsMap = (HashMap) d.calculateDistanceMetrics(graphModel.getGraph(), indicies, false, false);
double[] betweenness = metricsMap.get(GraphDistance.BETWEENNESS);
Node n1 = undirectedGraph.getNode("0");
Node n2 = undirectedGraph.getNode("1");
int index1 = indicies.get(n1);
int index2 = indicies.get(n2);
assertEquals(betweenness[index1], 10.0);
assertEquals(betweenness[index2], 0.0);