public void submitIndexingErrors(Collection<IndexingError> indexingErrors) {
        try {
            final FailureBatch fb = FailureBatch.indexingFailureBatch(
                    indexingErrors.stream()
                            .filter(ie -> {
                                if (!ie.message().supportsFailureHandling()) {
                                    logger.warn("Submitted a message with indexing errors, which doesn't support failure handling!");
                                    return false;
                                } else {
                                    return true;
                                }
                            })
                            .map(this::fromIndexingError)
                            .collect(Collectors.toList()));

            if (fb.size() > 0) {
                failureSubmissionQueue.submitBlocking(fb);
            }

        } catch (InterruptedException ignored) {
            logger.warn("Failed to submit {} indexing errors for failure handling. The thread has been interrupted!",
                    indexingErrors.size());
            Thread.currentThread().interrupt();
        }
    }
@Test
    public void submitIndexingErrors_messageNotSupportingFailureHandlingNotSubmittedToQueue() throws Exception {
        // given
        final Message msg1 = Mockito.mock(Message.class);
        when(msg1.getMessageId()).thenReturn("msg-1");
        when(msg1.supportsFailureHandling()).thenReturn(false);
        final Message msg2 = Mockito.mock(Message.class);
        when(msg2.getMessageId()).thenReturn("msg-2");
        when(msg2.supportsFailureHandling()).thenReturn(false);

        final List<IndexingError> indexingErrors = List.of(
                IndexingError.create(msg1, "index-1", MappingError, "Error"),
                IndexingError.create(msg2, "index-2", Unknown, "Error2")
        );

        // when
        underTest.submitIndexingErrors(indexingErrors);

        // then
        verifyNoInteractions(failureSubmissionQueue);
    }