### Question:
PubSubManager extends Manager { public boolean deleteNode(String nodeId) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { boolean res = true; try { sendPubsubPacket(Type.set, new NodeExtension(PubSubElementType.DELETE, nodeId), PubSubElementType.DELETE.getNamespace()); } catch (XMPPErrorException e) { if (e.getStanzaError().getCondition() == StanzaError.Condition.item_not_found) { res = false; } else { throw e; } } nodeMap.remove(nodeId); return res; } PubSubManager(XMPPConnection connection, BareJid toAddress); static PubSubManager getInstanceFor(XMPPConnection connection); static PubSubManager getInstanceFor(XMPPConnection connection, BareJid pubSubService); @Deprecated // TODO: Remove in Smack 4.5. static PubSubManager getInstance(XMPPConnection connection); @Deprecated // TODO: Remove in Smack 4.5. static PubSubManager getInstance(XMPPConnection connection, BareJid pubSubService); LeafNode createNode(); LeafNode createNode(String nodeId); Node createNode(String nodeId, FillableConfigureForm config); Node getNode(String id); LeafNode getOrCreateLeafNode(final String id); LeafNode getLeafNode(String id); LeafNode tryToPublishAndPossibleAutoCreate(String id, I item); DiscoverItems discoverNodes(String nodeId); List<Subscription> getSubscriptions(); List<Affiliation> getAffiliations(); boolean deleteNode(String nodeId); ConfigureForm getDefaultConfiguration(); BareJid getServiceJid(); DiscoverInfo getSupportedFeatures(); boolean supportsAutomaticNodeCreation(); boolean canCreateNodesAndPublishItems(); static DomainBareJid getPubSubService(XMPPConnection connection); static final String PLUS_NOTIFY; static final String AUTO_CREATE_FEATURE; }### Answer:
@Test public void deleteNodeTest() throws InterruptedException, SmackException, IOException, XMPPException { ThreadedDummyConnection con = ThreadedDummyConnection.newInstance(); PubSubManager mgr = new PubSubManager(con, DUMMY_PUBSUB_SERVICE); mgr.deleteNode("foo@bar.org"); PubSub pubSubDeleteRequest = con.getSentPacket(); assertEquals("http: assertEquals("pubsub", pubSubDeleteRequest.getChildElementName()); }