### Question:
GatewayPropertyWriter extends PropertyWriter { public void setGatewayDirection(Node n) { long incoming = countEdges(n.getInEdges()); long outgoing = countEdges(n.getOutEdges()); if (incoming <= 1 && outgoing > 1) { gateway.setGatewayDirection(GatewayDirection.DIVERGING); } else if (incoming > 1 && outgoing <= 1) { gateway.setGatewayDirection(GatewayDirection.CONVERGING); } else { gateway.setGatewayDirection(GatewayDirection.UNSPECIFIED); } } GatewayPropertyWriter(Gateway gateway, VariableScope variableScope); void setDefaultRoute(String defaultRouteExpression); void setSource(BasePropertyWriter source); void setTarget(BasePropertyWriter target); void setGatewayDirection(Node n); void setGatewayDirection(GatewayDirection direction);  }### Answer:
@Test public void testSetGatewayDirectionWithDivergingNode() { Node node = mockNode(1, 2); propertyWriter.setGatewayDirection(node); verify(element).setGatewayDirection(GatewayDirection.DIVERGING); }
@Test public void testSetGatewayDirectionWithConvergingNode() { Node node = mockNode(2, 1); propertyWriter.setGatewayDirection(node); verify(element).setGatewayDirection(GatewayDirection.CONVERGING); }
@Test public void testSetGatewayDirectionWithNotConfiguredNode() { Node node = mockNode(0, 0); propertyWriter.setGatewayDirection(node); verify(element).setGatewayDirection(GatewayDirection.UNSPECIFIED); }
@Test public void testSetGatewayDirection() { GatewayDirection randomDirection = GatewayDirection.CONVERGING; propertyWriter.setGatewayDirection(randomDirection); verify(element).setGatewayDirection(randomDirection); }