@Test public void testThrowingCheckedException() throws CheckedException1, CheckedException2 { assertEquals(0, usingArgs.throwingCheckedException(0, "foo")); try { usingArgs.throwingCheckedException(1, "bar"); } catch (CheckedException1 e) { } try { usingArgs.throwingCheckedException(2, "baz"); } catch (CheckedException2 e) { } }
@Privileged int throwingCheckedException(int which, String propertyToGet) throws CheckedException1, CheckedException2 { System.getProperty(propertyToGet); switch (which) { case 1: throw new CheckedException1(); case 2: throw new CheckedException2(); default: return which; } }
UsingArgs { @Privileged int throwingCheckedException(int which, String propertyToGet) throws CheckedException1, CheckedException2 { System.getProperty(propertyToGet); switch (which) { case 1: throw new CheckedException1(); case 2: throw new CheckedException2(); default: return which; } } }
UsingArgs { @Privileged int throwingCheckedException(int which, String propertyToGet) throws CheckedException1, CheckedException2 { System.getProperty(propertyToGet); switch (which) { case 1: throw new CheckedException1(); case 2: throw new CheckedException2(); default: return which; } }  }
UsingArgs { @Privileged int throwingCheckedException(int which, String propertyToGet) throws CheckedException1, CheckedException2 { System.getProperty(propertyToGet); switch (which) { case 1: throw new CheckedException1(); case 2: throw new CheckedException2(); default: return which; } }   }
UsingArgs { @Privileged int throwingCheckedException(int which, String propertyToGet) throws CheckedException1, CheckedException2 { System.getProperty(propertyToGet); switch (which) { case 1: throw new CheckedException1(); case 2: throw new CheckedException2(); default: return which; } }    }