package com.github.junit5docker;

import java.util.function.Supplier;

import static org.assertj.core.api.Assertions.fail;

final class ExecutorSanitizer {

    private ExecutorSanitizer() {
    }

    static Runnable ignoreInterrupted(InterruptibleRunnable callable) {
        return () -> {
            try {
                callable.run();
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
                fail("Test has been interrupted");
                throw new AssertionError("Bug in interruption ignorer");
            }
        };
    }

    static <T> Supplier<T> ignoreInterrupted(InterruptibleSupplier<T> callable) {
        return () -> {
            try {
                return callable.get();
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
                fail("Test has been interrupted");
                throw new AssertionError("Bug in interruption ignorer");
            }
        };
    }

    @FunctionalInterface
    interface InterruptibleRunnable {

        void run() throws InterruptedException;
    }

    @FunctionalInterface
    interface InterruptibleSupplier<T> {

        T get() throws InterruptedException;
    }

}

@@ -38,122 +38,180 @@
 ort 
-java.util.function.Supplier;%0A%0Aimport static org.assertj.core.api.Assertions.fail;%0A%0Afinal class ExecutorSanitizer %7B
+org.assertj.core.internal.Failures;%0A%0Aimport java.util.function.Supplier;%0A%0Afinal class ExecutorSanitizer %7B%0A%0A    private static final Failures FAILURES = Failures.instance();
 %0A%0A  
@@ -501,36 +501,54 @@
                 
+throw FAILURES.
 fail
+ure
 (%22Test has been 
@@ -566,81 +566,8 @@
 %22);%0A
-                throw new AssertionError(%22Bug in interruption ignorer%22);%0A
     
@@ -871,20 +871,38 @@
         
+throw FAILURES.
 fail
+ure
 (%22Test h
@@ -928,81 +928,8 @@
 %22);%0A
-                throw new AssertionError(%22Bug in interruption ignorer%22);%0A
     

Use assertJ messages in ExecutorSanitizer