@Test(expected = NullPointerException.class) public void testAddAllChannelsNull() { nodes.addAllChannels(null); }
public void addAllChannels(NodeList root) { for (int i = 0; i < root.getLength(); i++) { Node cur = root.item(i); if ("channel".equals(cur.getNodeName())) { this.addItem(cur); } else { if (cur.getChildNodes() != null && cur.getChildNodes().getLength() > 0) { addAllChannels(cur.getChildNodes()); } } } }
TabListOfNodes implements NodeList { public void addAllChannels(NodeList root) { for (int i = 0; i < root.getLength(); i++) { Node cur = root.item(i); if ("channel".equals(cur.getNodeName())) { this.addItem(cur); } else { if (cur.getChildNodes() != null && cur.getChildNodes().getLength() > 0) { addAllChannels(cur.getChildNodes()); } } } } }
TabListOfNodes implements NodeList { public void addAllChannels(NodeList root) { for (int i = 0; i < root.getLength(); i++) { Node cur = root.item(i); if ("channel".equals(cur.getNodeName())) { this.addItem(cur); } else { if (cur.getChildNodes() != null && cur.getChildNodes().getLength() > 0) { addAllChannels(cur.getChildNodes()); } } } }  }
TabListOfNodes implements NodeList { public void addAllChannels(NodeList root) { for (int i = 0; i < root.getLength(); i++) { Node cur = root.item(i); if ("channel".equals(cur.getNodeName())) { this.addItem(cur); } else { if (cur.getChildNodes() != null && cur.getChildNodes().getLength() > 0) { addAllChannels(cur.getChildNodes()); } } } }  @Override int getLength(); @Override Node item(int index); void addItem(Node node); void addAllChannels(NodeList root); }
TabListOfNodes implements NodeList { public void addAllChannels(NodeList root) { for (int i = 0; i < root.getLength(); i++) { Node cur = root.item(i); if ("channel".equals(cur.getNodeName())) { this.addItem(cur); } else { if (cur.getChildNodes() != null && cur.getChildNodes().getLength() > 0) { addAllChannels(cur.getChildNodes()); } } } }  @Override int getLength(); @Override Node item(int index); void addItem(Node node); void addAllChannels(NodeList root);  }