### Question:
DurationPresentation extends AbstractObservable { public void setQuantity(int quantity) { if (getDefined()) { int oldValue = d_data.quantity; d_data = new Data(d_data.units, quantity); d_bean.setDuration(d_data.getDuration()); firePropertyChange(PROPERTY_DURATION_QUANTITY, oldValue, quantity); } } DurationPresentation(T bean); static Data parseDuration(Duration duration, DateUnits prevUnits); DateUnits getUnits(); void setUnits(DateUnits units); int getQuantity(); void setQuantity(int quantity); boolean getDefined(); void setDefined(boolean defined); static Duration generateDuration(String duration); String getLabel(); @Override String toString(); static final String PROPERTY_DEFINED; static final String PROPERTY_DURATION_QUANTITY; static final String PROPERTY_DURATION_UNITS; static final String PROPERTY_LABEL; }### Answer:
@Test public void testSetQuantity() throws DatatypeConfigurationException { d_pm3.setQuantity(8); assertEquals(8, d_pm3.getQuantity()); assertEquals(DatatypeFactory.newInstance().newDuration("P8D"), d_epoch3.getDuration()); }