### Question:
RoundaboutService { public static boolean isRoundabout(Way way) { List<Node> nodes = way.getNodes(); if (nodes.size() > 1) { Node firstNode = nodes.get(0); Node lastNode = nodes.get(nodes.size() - 1); return firstNode.equals(lastNode); } else return false; }  static boolean isRoundabout(Way way);  }### Answer:
@Test public void testIsRoundabout() throws Exception { Node node1 = new Node(1, 0, 0); Node node2 = new Node(2, 1, 1); Node node3 = new Node(3, 1, 2); Node node4 = new Node(4, 0, 0); Node node1bad = new Node(1, 2, 2); assertRoundabout(false, Arrays.asList(node1)); assertRoundabout(false, Arrays.asList(node1, node2, node3, node4)); assertRoundabout(false, Arrays.asList(node1, node1bad)); assertRoundabout(true, Arrays.asList(node1, node1)); assertRoundabout(true, Arrays.asList(node1, node2, node1)); assertRoundabout(true, Arrays.asList(node1, node2, node4, node1)); }