### Question:
CcCourtAreaFieldValueConverter { public CcCourtArea convert(String ccCourtAreaFieldValue) { Preconditions.checkNotNull(ccCourtAreaFieldValue); String courtAreaStr = fieldValuePrefixAdder.extractFieldValue(ccCourtAreaFieldValue); String name = courtAreaStr.split(CcCourtAreaFieldValueCreator.CC_COURT_AREA_VALUE_PART_SEPARATOR)[0]; long courtId = Long.parseLong(courtAreaStr.split(CcCourtAreaFieldValueCreator.CC_COURT_AREA_VALUE_PART_SEPARATOR)[1]); CcCourtArea ccCourtArea = new CcCourtArea(); ccCourtArea.setCourtId(courtId); ccCourtArea.setName(name); return ccCourtArea; }  CcCourtArea convert(String ccCourtAreaFieldValue);  }### Answer:
@Test(expected=NullPointerException.class) public void convert_NULL() { ccCourtAreaFieldValueConverter.convert(null); }
@Test public void convert() { String sep = CcCourtAreaFieldValueCreator.CC_COURT_AREA_VALUE_PART_SEPARATOR; String courtAreaFieldValue = "123_Sąd Okręgowy w Poznaniu"+sep+"124"; when(fieldValuePrefixAdder.extractFieldValue(courtAreaFieldValue)).thenReturn("Sąd Okręgowy w Poznaniu"+sep+"124"); CcCourtArea ccCourtArea = ccCourtAreaFieldValueConverter.convert(courtAreaFieldValue); assertNotNull(ccCourtArea); assertEquals(124L, ccCourtArea.getCourtId()); assertEquals("Sąd Okręgowy w Poznaniu", ccCourtArea.getName()); }
@Test(expected=Exception.class) public void convert_IncorrectFieldValue() { String courtAreaFieldValue = "123_124Sąd Okręgowy w Poznaniu"; when(fieldValuePrefixAdder.extractFieldValue(courtAreaFieldValue)).thenReturn("124Sąd Okręgowy w Poznaniu"); ccCourtAreaFieldValueConverter.convert(courtAreaFieldValue); }