@Test public void checkValueTerseWay() throws Exception { try { checkerWithException.checkValue(0); fail("Expected exception for zero length"); } catch (IllegalArgumentException e) { assertTrue("expected", true); } }
public int checkValue(final int amount) { if (amount == 0) { throw new IllegalArgumentException("value is 0"); } return 0; }
CheckerWithException { public int checkValue(final int amount) { if (amount == 0) { throw new IllegalArgumentException("value is 0"); } return 0; } }
CheckerWithException { public int checkValue(final int amount) { if (amount == 0) { throw new IllegalArgumentException("value is 0"); } return 0; }  }
CheckerWithException { public int checkValue(final int amount) { if (amount == 0) { throw new IllegalArgumentException("value is 0"); } return 0; }  int checkValue(final int amount); }
CheckerWithException { public int checkValue(final int amount) { if (amount == 0) { throw new IllegalArgumentException("value is 0"); } return 0; }  int checkValue(final int amount);  }