@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); }); }
public void setTwin(BallItem twin) { this.twin = twin; }
BallThread extends Thread { public void setTwin(BallItem twin) { this.twin = twin; } }
BallThread extends Thread { public void setTwin(BallItem twin) { this.twin = twin; }  }
BallThread extends Thread { public void setTwin(BallItem twin) { this.twin = twin; }  void setTwin(BallItem twin); void run(); void suspendMe(); void resumeMe(); void stopMe(); }
BallThread extends Thread { public void setTwin(BallItem twin) { this.twin = twin; }  void setTwin(BallItem twin); void run(); void suspendMe(); void resumeMe(); void stopMe();  }