### Question:
BasicRiskDifference extends AbstractBasicRelativeEffect<RateMeasurement> implements BasicRateRelativeEffect { @Override public boolean isDefined() { return super.isDefined() && (d_baseline.getRate() > 0 || d_subject.getRate() > 0); } BasicRiskDifference(RateMeasurement baseline, RateMeasurement subject); @Override Double getError(); @Override boolean isDefined(); String getName(); Distribution getDistribution(); RelativeEffect<RateMeasurement> getCorrected(); @Override AxisType getAxisType();  }### Answer:
@Test public void testBothRatesZeroShouldBeUndefined() { BasicRateMeasurement base = new BasicRateMeasurement(0, 10); BasicRateMeasurement subj = new BasicRateMeasurement(0, 10); BasicRiskDifference rd = new BasicRiskDifference(base, subj); assertFalse(rd.isDefined()); }
@Test public void testOneRateZeroShouldBeDefined() { BasicRateMeasurement base = new BasicRateMeasurement(0, 10); BasicRateMeasurement subj = new BasicRateMeasurement(5, 10); BasicRiskDifference rd = new BasicRiskDifference(base, subj); assertTrue(rd.isDefined()); BasicRiskDifference rd2 = new BasicRiskDifference(subj, base); assertTrue(rd2.isDefined()); }