fixes #3178

Why don't you use @Test(expected=IllegalStateException.class)