### Question:
BallThread extends Thread { public void setTwin(BallItem twin) { this.twin = twin; }  void setTwin(BallItem twin); void run(); void suspendMe(); void resumeMe(); void stopMe();  }### Answer:
@Test public void testInterrupt() { assertTimeout(ofMillis(5000), () -> { final BallThread ballThread = new BallThread(); final UncaughtExceptionHandler exceptionHandler = mock(UncaughtExceptionHandler.class); ballThread.setUncaughtExceptionHandler(exceptionHandler); ballThread.setTwin(mock(BallItem.class)); ballThread.start(); ballThread.interrupt(); ballThread.join(); verify(exceptionHandler).uncaughtException(eq(ballThread), any(RuntimeException.class)); verifyNoMoreInteractions(exceptionHandler); }); }
@Test public void testInterrupt() { assertTimeout(ofMillis(5000), () -> { final var ballThread = new BallThread(); final var exceptionHandler = mock(UncaughtExceptionHandler.class); ballThread.setUncaughtExceptionHandler(exceptionHandler); ballThread.setTwin(mock(BallItem.class)); ballThread.start(); ballThread.interrupt(); ballThread.join(); verify(exceptionHandler).uncaughtException(eq(ballThread), any(RuntimeException.class)); verifyNoMoreInteractions(exceptionHandler); }); }
@Test public void testInterrupt() throws Exception { assertTimeout(ofMillis(5000), () -> { final BallThread ballThread = new BallThread(); final UncaughtExceptionHandler exceptionHandler = mock(UncaughtExceptionHandler.class); ballThread.setUncaughtExceptionHandler(exceptionHandler); ballThread.setTwin(mock(BallItem.class)); ballThread.start(); ballThread.interrupt(); ballThread.join(); verify(exceptionHandler).uncaughtException(eq(ballThread), any(RuntimeException.class)); verifyNoMoreInteractions(exceptionHandler); }); }