try { UncheckedThrow.throwAnyException(new CameraAccessException( CameraAccessException.CAMERA_DISCONNECTED)); Assert.fail("unreachable"); fakeNeverThrowsCameraAccess(); } catch (CameraAccessException e) { }