connectAndWrite(connector,1);
// wait until Iohandler has received all events
simpleIoHandler.messageSentLatch.await();
simpleIoHandler.sessionIdleLatch.await();
simpleIoHandler.sessionClosedLatch.await();
connector.dispose();
// make a copy to prevent ConcurrentModificationException
List<LoggingEvent> events = new ArrayList<LoggingEvent>(appender.events);
// verify that all logging events have correct MDC
for (LoggingEvent event : events) {