title: Unhandled Exception Junit
body: <p>I cannot run my test because the test gets red squiggly error line in this statement <code>decorator.decorate(new EncoderColumnDecorator())</code> requiring me to use either try/catch or add throws. 
      This is the error message. 
      <a href="https://i.stack.imgur.com/cDqEJ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/cDqEJ.png" alt="enter image description here"></a></p>
  
  <p>Why do I have to put either try/catch or throws exception when I already have an attribute "expected"</p>
  
  <p>My unit test:</p>
  
  <pre><code>@Test(expected=DecoratorException.class)
      public void testDecorate_exception() {
          decorator.decorate(new EncoderColumnDecorator()); -----Error in this line
      }
  </code></pre>
  
  <p>Method under test</p>
  
  <pre><code>@Override
      public String decorate(Object arg0) throws DecoratorException {
          try{
                  //some code     
              }
          }catch(Exception e){
              throw new DecoratorException();
          }       
          return arg0;
      }
  
  }
  </code></pre>