AdaptException extends HerajException { @Override public String getLocalizedMessage() { return String.format("Adapting from %s to %s failed", from.toString(), to.toString()); } AdaptException(final Class<?> from, final Class<?> to); @Override String getLocalizedMessage();  }
@Test public void testCreation() { AdaptException exception = new AdaptException(Object.class, String.class); assertNotNull(exception.from); assertNotNull(exception.to); logger.debug(exception.getLocalizedMessage()); }