@Override
    public void write(Message message) throws Exception {
        if (LOG.isTraceEnabled()) {
            LOG.trace("Writing message id to [{}]: <{}>", NAME, message.getId());
        }
        writeMessageEntries(List.of(DefaultFilteredMessage.forDestinationKeys(message, Set.of(FILTER_KEY))));
    }
@Test
    public void writeListWithMultipleStreams() throws Exception {
        final List<Message> messageList = buildMessages(4);

        // The bulkIndex method should receive a separate message per stream/index-set. If a message has two streams
        // with two different index sets, we should see the same message twice, one per index-set.
        messageList.forEach(message -> message.addStream(testStream));
        messageList.get(3).removeStream(defaultStream);

        output.write(messageList);

        verify(messages, times(1)).bulkIndex(argThat(argument -> {
            assertThat(argument).size().isEqualTo(7);
            assertThat(argument).containsExactlyInAnyOrderElementsOf(List.of(
                    new MessageWithIndex(wrap(messageList.get(0)), defaultIndexSet),
                    new MessageWithIndex(wrap(messageList.get(0)), testIndexSet),
                    new MessageWithIndex(wrap(messageList.get(1)), defaultIndexSet),
                    new MessageWithIndex(wrap(messageList.get(1)), testIndexSet),
                    new MessageWithIndex(wrap(messageList.get(2)), defaultIndexSet),
                    new MessageWithIndex(wrap(messageList.get(2)), testIndexSet),
                    // Only one message for the 4th message because it only contains the test stream.
                    new MessageWithIndex(wrap(messageList.get(3)), testIndexSet)
            ));
            return true;
        }));

        verifyNoMoreInteractions(messages);
    }