### Question:
FlexibleWay implements ConnectableSegment { @Override public SegmentNodes getSegmentNodes() { return new SegmentNodes(wayNodes.get(0), wayNodes.get(wayNodes.size() - 1)); } 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 testGetSegmentNodes() throws Exception { SegmentNodes segmentNodes = flexibleWay.getSegmentNodes(); assertEquals(firstNode, segmentNodes.getThisNode()); assertEquals(lastNode, segmentNodes.getOtherNode()); }