question: protected Set < Future < Void > > send ( String channelId , Object message ) { Collection < Session > sessions = ( channelId != null ) ? socketSessions . get ( channelId ) : null ; if ( sessions != null && ! sessions . isEmpty ( ) ) { Set < Future < Void > > results = new HashSet < > ( sessions . size ( ) ) ; String json = Json . encode ( message ) ; for ( Session session : sessions ) { if ( session . isOpen ( ) ) { send ( session , json , results ) ; } } return results ; } return emptySet ( ) ; }
target:  Encode the given message object as JSON and send it to all open web socket sessions associated with given web socket channel identifier.