private boolean filter(Message msg) {
        long seqId = msg.getSequenceId();
        msg.setContext(seqId);
        synchronized (this) {
            if (seqMap.containsKey(seqId)) {
                Queue<Message> queue = seqMap.computeIfAbsent(seqId, k -> new LinkedList<>());
                if (msg.getTrace().shouldTrace(TraceLevel.COMPONENT)) {
                    msg.getTrace().trace(TraceLevel.COMPONENT,
                                         "Sequencer queued message with sequence id '" + seqId + "'.");
                }
                queue.add(msg);
                return false;
            }
            seqMap.put(seqId, null);
        }
        return true;
    }
Filter a message against the current sequencing state. If this method returns true, the message has been cleared
for sending and its sequencing information has been added to the state. If this method returns false, it has been
queued for later sending due to sequencing restrictions. This method also sets the sequence id as message
context.

@param msg the message to filter
@return true if the message was consumed
messagebus/src/main/java/com/yahoo/messagebus/Sequencer.java