Code example for Set

Methods: isEmptyremove

0
            throw new IllegalArgumentException(String.format("Unexpected incoming message received: %s", message));
        } 
    } 
 
    private void removeProducer(Object producerId) { 
        producers.remove(producerId); 
        if (stopping && producers.isEmpty()) {
            LOGGER.debug("All producers finished. Stopping now."); 
            allProducersFinished(); 
        } 
    } 
 
    public void handleOutgoing(Message message) {
        if (message instanceof WorkerStopping) {
            workerStopped(); 
        } else if (message instanceof MessageCredits) {
            LOGGER.debug("Discarding {}.", message);
        } else { 
            throw new IllegalArgumentException(String.format("Unexpected outgoing message dispatched: %s", message));
        }