### Question:
FlexibleWay implements ConnectableSegment { @Override public boolean canConnectNodesInDirection(Node startNode, Node endNode) { return containsNodes(startNode, endNode); } FlexibleWay(List<Node> nodes); @Override SegmentNodes getSegmentNodes(); @Override ConnectableNode getEndpointNodes(); @Override Set<Node> getCommonNode(ConnectableSegment otherSegment); @Override boolean canConnect(ConnectableSegment otherSegment); @Override void appendNodesBetween(Collection<Node> nodes, Node startNode, Node endNode); @Override boolean containsNodes(Node... nodes); @Override boolean canConnectNodesInDirection(Node startNode, Node endNode); @Override double getLength();  }### Answer:
@Test public void testCanConnectNodesInDirection() throws Exception { assertTrue(flexibleWay.canConnectNodesInDirection(firstNode, lastNode)); assertTrue(flexibleWay.canConnectNodesInDirection(lastNode, firstNode)); }