public boolean submitProcessingErrors(Message message) {
        return submitProcessingErrorsInternal(message, message.processingErrors());
    }
@Test
    public void submitProcessingErrors_processingErrorSubmittedToQueueAndMessageFilteredOut_ifSubmissionEnabledAndDuplicatesAreNotKept() throws Exception {
        // given
        final Message msg = Mockito.mock(Message.class);
        when(msg.getMessageId()).thenReturn("msg-x");
        when(msg.supportsFailureHandling()).thenReturn(true);
        when(msg.processingErrors()).thenReturn(List.of(
                new Message.ProcessingError(() -> "Cause", "Message", "Details")
        ));

        when(failureHandlingConfiguration.submitProcessingFailures()).thenReturn(true);
        when(failureHandlingConfiguration.keepFailedMessageDuplicate()).thenReturn(false);

        // when
        final boolean notFilterOut = underTest.submitProcessingErrors(msg);

        // then

        assertThat(notFilterOut).isFalse();

        verify(msg).setFilterOut(true);

        verify(failureSubmissionQueue, times(1)).submitBlocking(failureBatchCaptor.capture());

        assertThat(failureBatchCaptor.getValue()).satisfies(fb -> {
            assertThat(fb.containsProcessingFailures()).isTrue();
            assertThat(fb.size()).isEqualTo(1);

            assertThat(fb.getFailures().get(0)).satisfies(processingFailure -> {
                assertThat(processingFailure.failureType()).isEqualTo(FailureType.PROCESSING);
                assertThat(processingFailure.failureCause().label()).isEqualTo("Cause");
                assertThat(processingFailure.message()).isEqualTo("Failed to process message with id 'msg-x': Message");
                assertThat(processingFailure.failureDetails()).isEqualTo("Details");
                assertThat(processingFailure.failureTimestamp()).isNotNull();
                assertThat(processingFailure.failedMessage()).isEqualTo(msg);
                assertThat(processingFailure.targetIndex()).isNull();
                assertThat(processingFailure.requiresAcknowledgement()).isTrue();
            });
        });
    }