private static void assertExceptionAndMessage(Exception e, Class<?> exceptionClass, String message, boolean exact) {
        if (exact) {
            assertEquals(message, e.getMessage());
        } else {
            assertTrue(e.getMessage().startsWith(message));
        }
        assertEquals(exceptionClass.getName(), e.getClass().getName());
    }
Unit tests for DefParser.

@author hmusum
@author gjoranv
configgen/src/test/java/com/yahoo/config/codegen/DefParserTest.java