### Question:
Manufacturer { public void setCode(String code) { this.code = code; }  Long getId(); void setId(Long id); String getCode(); void setCode(String code);  }### Answer:
@Test(expected = PersistenceException.class) public void testManufacturerCodeUnique() { Manufacturer manufacturer = new Manufacturer(); manufacturer.setCode("MOTOWN"); insertIntoDatabase(entityManagerFactory, manufacturer); manufacturer = new Manufacturer(); manufacturer.setCode("MOTOWN"); insertIntoDatabase(entityManagerFactory, manufacturer); }