@Test
    public void testThatAllThreadsAreDaemons() throws Exception {
        ProcessBuilder processBuilder = new ProcessBuilder(
            new File(System.getProperty("java.home")).toPath().resolve("bin").resolve("java").toString(),
            "-ea",
            "-classpath",
            System.getProperty("java.class.path"),
            DaemonTest.class.getCanonicalName()
        );

        assertThat(processBuilder.inheritIO().start().waitFor()).isZero();
    }
This test forks a new JVM, otherwise it's not possible to reliably diff the threads
core/src/test/java/org/testcontainers/DaemonTest.java