protected void done()
    {
        log("Start being done");
        if (!getNonProcessedStreamIDs().isEmpty()) {
            // If we recorded a stream ID, wait for this stream to be registered in the session manager before
            // continuing to prevent a race condition.
            final StreamID lastReceivedID = getNonProcessedStreamIDs().get(getNonProcessedStreamIDs().size()-1);
            log("Wait for stream to be registered in the session manager: " + lastReceivedID);
            final Instant stopWaiting = Instant.now().plus(500, ChronoUnit.MILLIS);
            try {
                final SessionManager sessionManager = XMPPServer.getInstance().getSessionManager();
                boolean found = false;
                while (Instant.now().isBefore(stopWaiting)) {
                    if (sessionManager.getIncomingServerSession( lastReceivedID ) != null) {
                        log("Found stream registered in the session manager: " + lastReceivedID);
                        found = true;
                        break;
                    }
                    Thread.sleep(10);
                }
                if (!found) log("NEVER FOUND STREAM WE WERE (pointlessly?) WAITING FOR: " + lastReceivedID);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }

        log("Phaser arriving and registering");
        phaser.arriveAndDeregister();
        log("Done being done");
    }
A monitor that is used to flag when this dummy has finished trying to set up a connection to Openfire. This is to
help the unit test know when it can start verifying the test outcome.
xmppserver/src/test/java/org/jivesoftware/openfire/session/RemoteInitiatingServerDummy.java