ManagerEvent removeMember ( BridgeLeaveEvent event ) { List < BridgeEnterEvent > remaining = null ; synchronized ( members ) { if ( members . remove ( event . getChannel ( ) ) != null && members . size ( ) == 2 ) { remaining = new ArrayList <> ( members . values ( ) ) ; } } // If we didn't remove anything, or we aren't at exactly 2 members, // there's nothing else for us to do if ( remaining == null ) { return null ; } return buildBridgeEvent ( BridgeEvent . BRIDGE_STATE_UNLINK , remaining ) ; }
If there are exactly 2 members in the bridge return a BridgeEvent