test_class.declarator: genericGraph
test_class.modifier: private static
test_class.original_string: private static GenericGraph<String> genericGraph;
test_class.type: GenericGraph<String>
test_class.var_name: genericGraph
test_class.file: singa-mathematics/src/test/java/bio/singa/mathematics/graphs/model/GenericGraphTest.java
test_class.identifier: GenericGraphTest
test_case.body: @Test
      void shouldAddAndConnectNodes() {
          Optional<GenericNode<String>> n1 = genericGraph.getNodeWithContent("N1");
          Optional<GenericNode<String>> n3 = genericGraph.getNodeWithContent("N3");
          // verify n1
          if (n1.isPresent()) {
              GenericNode<String> genericNode = n1.get();
              String actual = genericNode.getContent();
              assertEquals("N1", actual);
              GenericNode<String> neighbour = genericNode.getNeighbours().iterator().next();
              assertEquals("N3", neighbour.getContent());
          } else {
              fail("Node could not be retrieved from graph.");
          }
          // verify n2
          if (n3.isPresent()) {
              GenericNode<String> genericNode = n3.get();
              String actual = genericNode.getContent();
              assertEquals("N3", actual);
              GenericNode<String> neighbour = genericNode.getNeighbours().iterator().next();
              assertEquals("N1", neighbour.getContent());
          } else {
              fail("Node could not be retrieved from graph.");
          }
          // verify edge between them
          Collection<GenericEdge<String>> edges = genericGraph.getEdges();
          assertEquals(1, edges.size());
          GenericEdge<String> edge = edges.iterator().next();
          assertEquals("N1", edge.getSource().getContent());
          assertEquals("N3", edge.getTarget().getContent());
      }
test_case.class_method_signature: GenericGraphTest.shouldAddAndConnectNodes()
test_case.full_signature: @Test void shouldAddAndConnectNodes()
test_case.identifier: shouldAddAndConnectNodes
test_case.invocations: getNodeWithContent getNodeWithContent isPresent get getContent assertEquals next iterator getNeighbours assertEquals getContent fail isPresent get getContent assertEquals next iterator getNeighbours assertEquals getContent fail getEdges assertEquals size next iterator assertEquals getContent getSource assertEquals getContent getTarget
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldAddAndConnectNodes()
focal_class.declarator: nextNodeIdentifier
focal_class.modifier: private
focal_class.original_string: private int nextNodeIdentifier;
focal_class.type: int
focal_class.var_name: nextNodeIdentifier
focal_class.file: singa-mathematics/src/main/java/bio/singa/mathematics/graphs/model/GenericGraph.java
focal_class.identifier: GenericGraph
focal_class.class_method_signature: GenericGraph.addEdgeBetween(int identifier, GenericNode<ContentType> source, GenericNode<ContentType> target)
focal_class.full_signature: @Override public int addEdgeBetween(int identifier, GenericNode<ContentType> source, GenericNode<ContentType> target)
focal_class.identifier: addEdgeBetween
focal_class.modifiers: @Override public
focal_class.parameters: (int identifier, GenericNode<ContentType> source, GenericNode<ContentType> target)
focal_class.return: int
focal_class.signature: int addEdgeBetween(int identifier, GenericNode<ContentType> source, GenericNode<ContentType> target)
focal_class.class_method_signature: GenericGraph.addEdgeBetween(GenericNode<ContentType> source, GenericNode<ContentType> target)
focal_class.full_signature: @Override public int addEdgeBetween(GenericNode<ContentType> source, GenericNode<ContentType> target)
focal_class.identifier: addEdgeBetween
focal_class.modifiers: @Override public
focal_class.parameters: (GenericNode<ContentType> source, GenericNode<ContentType> target)
focal_class.return: int
focal_class.signature: int addEdgeBetween(GenericNode<ContentType> source, GenericNode<ContentType> target)
focal_class.class_method_signature: GenericGraph.addEdgeBetween(ContentType sourceContent, ContentType targetContent)
focal_class.full_signature: public int addEdgeBetween(ContentType sourceContent, ContentType targetContent)
focal_class.identifier: addEdgeBetween
focal_class.modifiers: public
focal_class.parameters: (ContentType sourceContent, ContentType targetContent)
focal_class.return: int
focal_class.signature: int addEdgeBetween(ContentType sourceContent, ContentType targetContent)
focal_class.class_method_signature: GenericGraph.nextNodeIdentifier()
focal_class.full_signature: @Override public Integer nextNodeIdentifier()
focal_class.identifier: nextNodeIdentifier
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Integer
focal_class.signature: Integer nextNodeIdentifier()
focal_class.class_method_signature: GenericGraph.addNode(ContentType content)
focal_class.full_signature: public GenericNode<ContentType> addNode(ContentType content)
focal_class.identifier: addNode
focal_class.modifiers: public
focal_class.parameters: (ContentType content)
focal_class.return: GenericNode<ContentType>
focal_class.signature: GenericNode<ContentType> addNode(ContentType content)
focal_class.class_method_signature: GenericGraph.containsNodeWithContent(ContentType content)
focal_class.full_signature: public boolean containsNodeWithContent(ContentType content)
focal_class.identifier: containsNodeWithContent
focal_class.modifiers: public
focal_class.parameters: (ContentType content)
focal_class.return: boolean
focal_class.signature: boolean containsNodeWithContent(ContentType content)
focal_class.class_method_signature: GenericGraph.getNodeWithContent(ContentType content)
focal_class.full_signature: public Optional<GenericNode<ContentType>> getNodeWithContent(ContentType content)
focal_class.identifier: getNodeWithContent
focal_class.modifiers: public
focal_class.parameters: (ContentType content)
focal_class.return: Optional<GenericNode<ContentType>>
focal_class.signature: Optional<GenericNode<ContentType>> getNodeWithContent(ContentType content)
focal_class.class_method_signature: GenericGraph.getCopy()
focal_class.full_signature: public GenericGraph<ContentType> getCopy()
focal_class.identifier: getCopy
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: GenericGraph<ContentType>
focal_class.signature: GenericGraph<ContentType> getCopy()
focal_class.superclass: extends AbstractMapGraph<GenericNode<ContentType>, GenericEdge<ContentType>, Vector2D, Integer>
focal_method.body: public Optional<GenericNode<ContentType>> getNodeWithContent(ContentType content) {
          for (GenericNode<ContentType> genericNode : getNodes()) {
              if (genericNode.getContent().equals(content)) {
                  return Optional.of(genericNode);
              }
          }
          return Optional.empty();
      }
focal_method.class_method_signature: GenericGraph.getNodeWithContent(ContentType content)
focal_method.full_signature: public Optional<GenericNode<ContentType>> getNodeWithContent(ContentType content)
focal_method.identifier: getNodeWithContent
focal_method.invocations: getNodes equals getContent of empty
focal_method.modifiers: public
focal_method.parameters: (ContentType content)
focal_method.return: Optional<GenericNode<ContentType>>
focal_method.signature: Optional<GenericNode<ContentType>> getNodeWithContent(ContentType content)