@RunWith(PowerMockRunner.class)
@PrepareForTest(A.class)
public class Test {
private B b = new B();
@Test(expected = IllegalStateException.class)
public void testIOException() throws Exception {
PowerMockito.mockStatic(A.class);
PowerMockito.when(A.method()).thenThrow(new IOException());
b.service();
}
}