@Test
public void testKnowledgeBaseEventSupportLeak() throws Exception {
// JBRULES-3666
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
KieBaseEventListener listener = new DefaultKieBaseEventListener();
kbase.addEventListener(listener);
kbase.addEventListener(listener);
assertEquals(1, ((KnowledgeBaseImpl) kbase).getRuleBase().getRuleBaseEventListeners().size());
kbase.removeEventListener(listener);
assertEquals(0, ((KnowledgeBaseImpl) kbase).getRuleBase().getRuleBaseEventListeners().size());