try {
p = mgr.create(null);
fail();
} catch (final Exception e) {
assertTrue(e.getCause() instanceof ConstraintViolationException);
final ConstraintViolationException cvs = (ConstraintViolationException) e.getCause();
assertEquals(1, cvs.getConstraintViolations().size());
}
try {
mgr.drive(p, 17);
fail();
} catch (final Exception e) {
assertTrue(e.getCause() instanceof ConstraintViolationException);
final ConstraintViolationException cvs = (ConstraintViolationException) e.getCause();
assertEquals(1, cvs.getConstraintViolations().size());
}
}