@Test
    public void testUninterruptibleJoin2() {
        class InterruptingThread extends Thread {
            Thread threadToInterrupt;
            InterruptingThread(Thread threadToInterrupt) { this.threadToInterrupt = threadToInterrupt; }

            public void run() {
                try {
                    Thread.sleep(100);
                    threadToInterrupt.interrupt();
                } catch(InterruptedException e) {
                    throw new AssertionError(); /* unexpected */
                }
            }
        };

        Thread interruptingThread = new InterruptingThread(Thread.currentThread());
        interruptingThread.start();

        Thread thread = new Thread() {
            public void run() {
                try {
                    Thread.sleep(250);
                } catch(InterruptedException e) {
                    throw new AssertionError(); /* unexpected */
                }
            }
        };

        /* If the interrupted flag is set before joinThreadUninterruptible is
         * called, it must be set when it returns. */
        thread.setName("UninterruptibleJoinThread");
        thread.start();

        assertFalse("Interrupt flag should not be set yet", Thread.interrupted());

        Helpers.joinThreadUninterruptible(thread);

        assertTrue("Interrupt flag should be set", Thread.interrupted());

        // Shut down the helper thread, too.
        Helpers.joinThreadUninterruptible(interruptingThread);
    }