I have a problem with throw InterruptedException. Part of my source:
Future<Object> future = mock(Future.class);
when(future.get(any(), any())).thenThrow(new InterruptedException());
But I get java.lang.NullPointerException on the second line, What's wrong with my code? I want to throw InterruptedException when I call get method