### Question:
DoseUnit extends AbstractEntity implements TypeWithDuration { @Override public boolean equals(final Object other) { if (other == null || !(other instanceof DoseUnit)) { return false; } DoseUnit o = (DoseUnit) other; return EqualsUtil.equal(d_unit, o.d_unit) && EqualsUtil.equal(d_scaleModifier, o.d_scaleModifier) && EqualsUtil.equal(d_perTime, o.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 testEquals() { assertFalse(d_mgDay.equals(d_kgHr)); assertEntityEquals(d_mgDay, d_mgDay); DoseUnit du = new DoseUnit(new Unit("gram", "gg"), ScaleModifier.MILLI, EntityUtil.createDuration("P1D")); DoseUnit du2 = new DoseUnit(new Unit("gram", "gg"), ScaleModifier.MILLI, EntityUtil.createDuration("P1D")); assertEntityEquals(du, du2); assertEquals(d_mgDay, du); assertFalse(d_mgDay.deepEquals(du)); }