TemplatesIteratorException extends RuntimeException { @Override public synchronized IOException getCause() { return (IOException) super.getCause(); } TemplatesIteratorException(IOException cause); @Override synchronized IOException getCause();  }
@Test public void testCauseConstructor() { IOException ioException = mock(IOException.class); assertEquals(ioException, new TemplatesIteratorException(ioException).getCause()); }