@Test
public void inPortNodes() {

    List<InPortNode> inPortNodes = diamondGraph.inPortNodes();
    Assert.assertEquals(COMPOSITE_MODULE.getInPorts().size(), 2);
    Assert.assertEquals(
        inPortNodes.stream().map(InPortNode::getElement).collect(Collectors.toList()),
        COMPOSITE_MODULE.getInPorts()
    );
    Assert.assertTrue(
        COMPOSITE_MODULE.getInPorts().stream()
            .allMatch(inPort -> inPortNodes.get(inPort.getInIndex()) == diamondGraph.sourceNode(inPort))
    );
}