DGRN { public List<Edge> getAllEdgesOf(Node node) { List<Edge> edges = new ArrayList<Edge>(); for (Edge edge : graph.getAllEdges()) { if (edge.getSource().getId().equals(node.getId()) || edge.getTarget().getId().equals(node.getId())) { edges.add(edge); } } return edges; } DGRN(String creator, String description, AttributeList attrList, Attribute attributeActivationValue,
                OutflowNodeHandler outflowNodeHandler, InflowNodeHandler inflowNodeHandler); private  DGRN(String creator, String description, AttributeList attrList, Attribute attributeActivationValue,
                 OutflowNodeHandler outflowNodeHandler, InflowNodeHandler inflowNodeHandler, Random randomizer); static int getNodeAttributeIndex(Node node, String attributeId); static void setNodeAttributeValue(Node node, String attributeId, String newValue); static String getNodeAttributeValue(Node node, String attributeId); List<Edge> getAllEdgesOf(Node node); void connect(String nodeId1, String nodeId2, int connectionWeight); void tick(); void inheritGenes(DGRN parent, int maxAlleles); void saveGraph(Gexf gexf); Node getNode(String nodeId); static Attribute attr_ActivationValue; static Attribute attr_AlleleCount; final Random randomGenerator; public Graph graph; final String ACTIVATION_VALUE_ID; }
@Test public void testGetAllEdgesOf() { DGRN dgrn = getMockDGRN(); Node in = dgrn.graph.createNode("in"); Node middle = dgrn.graph.createNode("middle"); Node out = dgrn.graph.createNode("out"); in.connectTo(middle); middle.connectTo(out); List<Edge> edges = dgrn.getAllEdgesOf(middle); Assert.assertEquals(2, edges.size()); }