### Question:
DoseUnit extends AbstractEntity implements TypeWithDuration { @Override public DoseUnit clone() { return new DoseUnit(d_unit, d_scaleModifier, d_perTime); } DoseUnit(final Unit u, final ScaleModifier scaleMod, final Duration perTime); @Override Set<? extends Entity> getDependencies(); Unit getUnit(); ScaleModifier getScaleModifier(); Duration getPerTime(); void setUnit(final Unit unit); void setScaleModifier(final ScaleModifier scaleMod); void setPerTime(final Duration perTime); @Override String getLabel(); @Override boolean equals(final Object other); @Override boolean deepEquals(final Entity other); @Override DoseUnit clone(); @Override String toString(); @Override Duration getDuration(); @Override void setDuration(final Duration duration); static double convert(final double quantity, final DoseUnit from, final DoseUnit to); static DoseUnit createDefault(); static DoseUnit createMilliGramsPerDay(); static final String PROPERTY_SCALE_MODIFIER; static final String PROPERTY_UNIT; static final String PROPERTY_PER_TIME; }### Answer:
@Test public void testClone() throws DatatypeConfigurationException { DoseUnit cloned = d_mgDay.clone(); assertEntityEquals(d_mgDay, cloned); assertNotSame(d_mgDay, cloned); cloned.setScaleModifier(ScaleModifier.KILO); JUnitUtil.assertNotEquals(d_mgDay.getScaleModifier(), cloned.getScaleModifier()); cloned.setScaleModifier(ScaleModifier.MILLI); assertEquals(d_mgDay.getScaleModifier(), cloned.getScaleModifier()); cloned.setUnit(new Unit("nonsense", "ns")); JUnitUtil.assertNotEquals(d_mgDay.getUnit(), cloned.getUnit()); cloned.setUnit(d_mgDay.getUnit()); assertEquals(d_mgDay.getUnit(), cloned.getUnit()); cloned.setPerTime(DatatypeFactory.newInstance().newDuration("P2D")); JUnitUtil.assertNotEquals(d_mgDay.getPerTime(), cloned.getPerTime()); cloned.setPerTime(d_mgDay.getPerTime()); assertEquals(d_mgDay.getPerTime(), cloned.getPerTime()); }