### Question:
CrnConverter implements AttributeConverter<Crn, String> { @Override public Crn convertToEntityAttribute(String dbData) { return Crn.safeFromString(dbData); }  @Override String convertToDatabaseColumn(Crn attribute); @Override Crn convertToEntityAttribute(String dbData);  }### Answer:
@Test public void testConvertToEntityAttribute() { Crn dbCrn = underTest.convertToEntityAttribute(validCrn.toString()); assertEquals(validCrn, dbCrn); }
@Test(expected = CrnParseException.class) public void testConvertToEntityAttributeInvalidCrnString() { underTest.convertToEntityAttribute("nope"); }