@Test
public void testMessages() {

    String s;
    String message = "exception message 12345";
    Throwable[] causes;
    // ----------------- 
    causes = new Throwable[] {new RuntimeException("12345"), new RuntimeException("abcd") };
    
    s = new ValidationException(message, causes).getMessage();
    assertTrue(s.startsWith(message));
    assertTrue(s.contains("\n12345"));
    assertTrue(s.contains("\nabcd"));
    
    s = new ValidationException(causes).getMessage();
    assertTrue(s.startsWith("12345\n"));
    assertTrue(s.endsWith("\nabcd"));
    // -----------------
    causes = new Throwable[] { new RuntimeException(), new RuntimeException() };
    s = new ValidationException(message, causes).getMessage();
    assertTrue(s.startsWith(message));
    assertTrue(s.indexOf("java.lang.RuntimeException") != s.lastIndexOf("java.lang.RuntimeException")); 
    
    s = new ValidationException(causes).getMessage();
    assertEquals("java.lang.RuntimeException\njava.lang.RuntimeException", s); 
    // -----------------
    causes = new Throwable[] { new RuntimeException(), new RuntimeException("67890") };
    s = new ValidationException(message, causes).getMessage();
    assertTrue(s.startsWith(message));
    assertTrue(s.contains("\njava.lang.RuntimeException"));
    assertTrue(s.contains("\n67890"));
    s = new ValidationException(causes).getMessage();
    assertTrue(s.startsWith("java.lang.RuntimeException\n"));
    assertTrue(s.endsWith("\n67890"));
    // -----------------
    causes = new Throwable[] {};
    s = new ValidationException(message, causes).getMessage();
    assertEquals(s, message);
    s = new ValidationException(causes).getMessage();
    assertEquals(s, ValidationException.class.getName());
    // -----------------
    causes = null;
    s = new ValidationException(message, causes).getMessage();
    assertEquals(s, message);
    s = new ValidationException(causes).getMessage();
    assertEquals(s, ValidationException.class.getName());

    // -----------------
    Throwable cause = null;
    s = new ValidationException(message, cause).getMessage();
    assertEquals(s, message);
    s = new ValidationException(cause).getMessage();
    assertEquals(s, ValidationException.class.getName());
}