I cannot run my test because the test gets red squiggly error line in this statement decorator.decorate(new EncoderColumnDecorator()) requiring me to use either try/catch or add throws. This is the error message. 
Why do I have to put either try/catch or throws exception when I already have an attribute "expected"
My unit test:
@Test(expected=DecoratorException.class) public void testDecorate_exception() { decorator.decorate(new EncoderColumnDecorator()); -----Error in this line } Method under test
@Override public String decorate(Object arg0) throws DecoratorException { try{ //some code } }catch(Exception e){ throw new DecoratorException(); } return arg0; } }