try
{
handler.start();
ObjectName name = ObjectName.getInstance(":name=emitter");
handler.addNotificationListener(new Integer(1), new NotificationTuple(name, listener, null, null));
Object handback = new Object();
handler.addNotificationListener(new Integer(2), new NotificationTuple(name, listener, null, handback));
handler.removeNotificationListeners(new Integer[]{new Integer(2)});
assertFalse(handler.contains(new NotificationTuple(name, listener, null, handback)));
assertTrue(handler.contains(new NotificationTuple(name, listener, null, null)));
Integer id = handler.getNotificationListener(new NotificationTuple(name, listener, null, null));
assertEquals(id.intValue(), 1);
handler.removeNotificationListeners(new Integer[]{new Integer(1)});
assertFalse(handler.contains(new NotificationTuple(name, listener, null, null)));
}
finally
{
handler.stop();
}