Cases { public static <R> R illegal(String message) { throw new IllegalStateException(message); } private  Cases(); static R illegal(String message); static R todo();  }
@Test public void shouldThrowIllegalStateExceptionForIllegal() throws Exception { thrown.expect(IllegalStateException.class); thrown.expectMessage("don't do this dude"); Cases.illegal("don't do this dude"); }