@Override public void run(){ try { TimeUnit.MILLISECONDS.sleep(pauseToCheckForRemainingThreads); // Allow enough time for JVM to exit } catch (InterruptedException ignored) { Thread.currentThread().interrupt(); } // This is a daemon thread, which should only reach here if there are other // non-daemon threads still active System.out.println("The JVM should have exited but did not.");//NOSONAR System.out.println("The following non-daemon threads are still running (DestroyJavaVM is OK):");//NOSONAR JOrphanUtils.displayThreads(false); }