private synchronized Set<JID> doStopInbound( @Nullable JID peer ) {
        if ( peer != null && !peer.asBareJID().equals(peer) ) {
            throw new IllegalArgumentException( "Expected argument 'peer' to be null or a bare JID, but it was not: " + peer );
        }

        final Set<JID> result = new HashSet<>();
        if ( inboundJoins.isEmpty() ) {
            Log.trace( "(room: '{}'): No remote MUC joining us. No need to inform joining nodes that they have now left.", room.getJID() );
        } else {
            final Iterator<Map.Entry<JID, InboundJoin>> iterator = inboundJoins.entrySet().iterator();
            while ( iterator.hasNext() )
            {
                final InboundJoin inboundJoin = iterator.next().getValue();
                if ( peer != null && !inboundJoin.getPeer().equals( peer )) {
                    // This is not the peer you're looking for.
                    continue;
                }
                iterator.remove(); // Remove inboundJoin so that it's no longer send stanzas, and incoming stanzas are being treated as if from an unconnected entity.

                result.addAll( inboundJoin.occupants );

                try
                {
                    Log.trace("(room: '{}'): Informing joining node '{}' that it is leaving the FMUC node set.", room.getJID(), inboundJoin.getPeer());
                    final Presence left = new Presence();
                    left.setFrom(room.getJID());
                    left.setTo(inboundJoin.getPeer());
                    left.getElement().addElement(FMUC).addElement("left");
                    XMPPServer.getInstance().getPacketRouter().route(left);
                }
                catch ( Exception e )
                {
                    Log.warn("(room: '{}'): An exception occurred while informing joining node '{}' that it is leaving the FMUC node set.", room.getJID(), inboundJoin.getPeer(), e);
                }
            }
        }
        return result;
    }
Identical to {@link #doStopInbound()} but used to disconnect just one node, instead of all of them.

When null is passed as an argument, all inbound nodes are disconnected (equivalent to a call to {@link #doStopInbound()}).

@param peer the address of the remote node (must be a bare JID), or null to remove all nodes.
@return The JIDs of occupants on the remote, joining node that are no longer in the room.
@see #doStopInbound()
xmppserver/src/main/java/org/jivesoftware/openfire/muc/spi/FMUCHandler.java