public String doSomething(boolean exp) { if (exp) { return "ok"; } else { throw new IllegalArgumentException( "expression must be true but was not"); } } }
@Test public void testCatchException() throws Exception {
final X x = new X();
// the following code block is a single line of code in Java 8 catchException(new Callable<String>() {