}
@Test
public void testParse() {
assertNull(addressParser.parse(null));
Address address = new Address();
address.setProvince(new Province());
address.getProvince().setId(baseDao.first(Province.class).getId());
address.setType(new AddressType());
address.getType().setId(baseDao.first(AddressType.class).getId());
address = addressParser.parse(address);
assertNotNull(address.getProvince().getCountry());
assertNotNull(address.getType().getType());
address = new Address();
address.setId(baseDao.first(Address.class).getId());
address.setPostalCode("00001");
address = addressParser.parse(address);
assertEquals(address.getPostalCode(), "00001");
assertNull(address.getProvince());
address = new Address();
address.setId(baseDao.first(Address.class).getId());
address.setPostalCode("00001");
address.setProvince(baseDao.find(Province.class, 0, 2).get(1));
address = addressParser.parse(address);
assertFalse(address.getProvince().getId().equals(baseDao.first(Province.class).getId()));
}