### Question:
XWikiNotificationManager { public void removeNamedRule(String name) { synchronized (namedrules) { Vector<XWikiNotificationRule> vnamedrules = namedrules.get(name); if (vnamedrules != null) { vnamedrules.removeAllElements(); } namedrules.remove(name); } } XWikiNotificationManager(); void addGeneralRule(XWikiNotificationRule rule); void removeGeneralRule(XWikiNotificationRule rule); void addNamedRule(String name, XWikiNotificationRule rule); void removeNamedRule(String name); void removeNamedRule(String name, XWikiNotificationRule rule); Vector<XWikiNotificationRule> getNamedRules(String name); void preverify(XWikiDocument newdoc, XWikiDocument olddoc, int event, XWikiContext context); void verify(XWikiDocument newdoc, XWikiDocument olddoc, int event, XWikiContext context); void verify(XWikiDocument doc, String action, XWikiContext context); void preverify(XWikiDocument doc, String action, XWikiContext context);  }### Answer:
@Test public void testRemoveNamedRule() { assertNull(notificationManager.getNamedRules("testrule")); notificationManager.addNamedRule("testrule", getDummyNotificationRule()); notificationManager.addNamedRule("testrule", getDummyNotificationRule()); assertEquals(2, notificationManager.getNamedRules("testrule").size()); notificationManager.removeNamedRule("testrule"); assertNull(notificationManager.getNamedRules("testrule")); }