final long start = now();
final Set<AMX> all = getAllAMX();
final NotificationListener listener1 = new DummyListener();
final NotificationListener listener2 = new DummyListener();
final NotificationFilter filter = new NotificationFilterSupport();
final Object handback = "handback";
for( final AMX amx : all )
{
amx.getNotificationInfo();
amx.addNotificationListener( listener1, null, null );
amx.addNotificationListener( listener2, filter, handback );
}
for( final AMX amx : all )
{
amx.removeNotificationListener( listener1 );
amx.removeNotificationListener( listener2, filter, handback );
}
printElapsed( "Added/removed NotificationListener", all.size(), start );