### Question:
NodeServiceImpl extends ServiceSupport implements NodeService { public Node getNode(String nodeName) { Node node = findNode(nodeName); if (node == null) { throw new NodeNotFoundException(String.format("Node %s not found.", nodeName)); } return node; } @Inject  NodeServiceImpl(final SecurityService security); Node getNode(String nodeName); Node findNode(final String nodeName); Node getMasterNode(); List<Node> getAllNodes(); List<Node> getNodes(); Node getCurrentNode();  }### Answer:
@Test(expected=NullPointerException.class) public void getNodeNullArg() { getInst().getNode(null); }
@Test(expected=NodeNotFoundException.class) public void getNodeNotFound() { getInst().getNode("nodeName"); }
@Test public void getNodeSecurity() { when(hudson.getNode("nodeName")).thenReturn(node); assertThat(getInst().getNode("nodeName"), equalTo(node)); Mockito.verify(security).checkPermission(node, Permission.READ); }