details2.addMessage("key2", "context2", null);
InvalidDataException e2 = new InvalidDataException("message2", details2);
ValidationErrors details3 = new ValidationErrors();
details3.addMessage("key3a", "context3a", null);
details3.addMessage("key3b", null);
InvalidDataException e3 = new InvalidDataException("message3", details3);
assertContainsMessage(e1, "key1");
assertContainsMessage(e1, "key1", null);
assertContainsMessage(e2, "key2", "context2");