Document doc = nonValidatingDocumentBuilder.parse(classLoader.getResourceAsStream("unmarshal/when.xml"));
Object whenObj = unmarshaller.unmarshal(doc);
Assert.assertTrue(whenObj instanceof When);
When w = (When) whenObj;
Assert.assertNotNull(w.getConstraints());
Assert.assertEquals(1, w.getConstraints().size());
Assert.assertTrue(w.getConstraints().get(0) instanceof IsNullConstraint);
Assert.assertTrue(((IsNullConstraint) w.getConstraints().get(0)).getApplyTo().get(0).equals("a"));
Assert.assertNotNull(w.getThenConstraints());
Assert.assertEquals(1, w.getThenConstraints().size());
Assert.assertTrue(w.getThenConstraints().get(0) instanceof IsNullConstraint);
Assert.assertTrue(((IsNullConstraint) w.getThenConstraints().get(0)).getApplyTo().get(0).equals("b"));
Assert.assertNotNull(w.getElseConstraints());
Assert.assertEquals(1, w.getElseConstraints().size());
Assert.assertTrue(w.getElseConstraints().get(0) instanceof IsNullConstraint);
Assert.assertTrue(((IsNullConstraint) w.getElseConstraints().get(0)).getApplyTo().get(0).equals("c"));
}