### Question:
CorrectedBasicRiskDifference extends BasicRiskDifference implements
		RelativeEffect<RateMeasurement> { @Override public boolean isDefined() { return super.isDefined() && (getA() != 0.5 || getC() != 0.5) && (getB() != 0.5 || getD() != 0.5); } CorrectedBasicRiskDifference(RateMeasurement baseline,
			RateMeasurement subject);  CorrectedBasicRiskDifference(BasicRiskDifference basicRiskDifference); @Override String getName(); @Override boolean isDefined();  }### Answer:
@Test public void testZeroBaselineRateShouldBeDefined() { RateMeasurement base = new BasicRateMeasurement(0, 100); RateMeasurement subj = new BasicRateMeasurement(50, 100); CorrectedBasicRiskDifference or = new CorrectedBasicRiskDifference(base, subj); assertTrue(or.isDefined()); }
@Test public void testZeroRateBaselineAndSubjectShouldNotBeDefined() { RateMeasurement base = new BasicRateMeasurement(0, 100); RateMeasurement subj = new BasicRateMeasurement(0, 100); CorrectedBasicRiskDifference or = new CorrectedBasicRiskDifference(base, subj); assertFalse(or.isDefined()); }
@Test public void testZeroSubjectRateShouldBeDefined() { RateMeasurement base = new BasicRateMeasurement(50, 100); RateMeasurement subj = new BasicRateMeasurement(0, 100); CorrectedBasicRiskDifference or = new CorrectedBasicRiskDifference(base, subj); assertTrue(or.isDefined()); }
@Test public void testFullBaselineRateShouldBeDefined() { RateMeasurement base = new BasicRateMeasurement(100, 100); RateMeasurement subj = new BasicRateMeasurement(50, 100); CorrectedBasicRiskDifference or = new CorrectedBasicRiskDifference(base, subj); assertTrue(or.isDefined()); }
@Test public void testFullRateBaselineAndSubjectShouldNotBeDefined() { RateMeasurement base = new BasicRateMeasurement(100, 100); RateMeasurement subj = new BasicRateMeasurement(100, 100); CorrectedBasicRiskDifference or = new CorrectedBasicRiskDifference(base, subj); assertFalse(or.isDefined()); }
@Test public void testFullSubjectRateShouldBeDefined() { RateMeasurement base = new BasicRateMeasurement(50, 100); RateMeasurement subj = new BasicRateMeasurement(100, 100); CorrectedBasicRiskDifference or = new CorrectedBasicRiskDifference(base, subj); assertTrue(or.isDefined()); }