TxDetail implements Serializable { public void setDetailValue(String detailValue) { if (detailValue == null) throw new IllegalArgumentException("Detail value cannot be null"); this.detailValue = detailValue; } TxDetail();  TxDetail(TxDetailType detailName, String detailValue);  TxDetail(String detailName, String detailValue); void setDetailName(String detailName); String getDetailName(); void setDetailValue(String detailValue); String getDetailValue(); @Override String toString();  }
@Test public void testConstruct_setValue_nullValue() { TxDetail detail = new TxDetail(); boolean exceptionOccured = false; try { detail.setDetailValue(null); } catch (IllegalArgumentException e) { exceptionOccured = true; } assertTrue(exceptionOccured); }