checked(rn2.getNewRoleValue(), ObjectName.class)
.equals(singletonList(moduleA)));
ObjectName timerName = new ObjectName(":type=timer");
mbs.registerMBean(new Timer(), timerName);
TimerMBean timer =
MBeanServerInvocationHandler.newProxyInstance(mbs,
timerName,
TimerMBean.class,
false);
Date doomsday = new Date(Long.MAX_VALUE);
int timer1 = timer.addNotification("one", "one", null, doomsday);
int timer2 = timer.addNotification("two", "two", null, doomsday);
Vector<Integer> idsOne = timer.getNotificationIDs("one");
check("Vector<Integer> TimerMBean.getNotificationIDs",
idsOne.equals(singletonList(timer1)));
Vector<Integer> allIds = timer.getAllNotificationIDs();
check("Vector<Integer> TimerMBean.getAllNotificationIDs",
equalListContents(allIds,
Arrays.asList(new Integer[]{timer1, timer2})));
// ADD NEW TEST CASES ABOVE THIS COMMENT