AmberQC { public AmberQCStatus status() { if (Doubles.greaterThan(meanBAF(), MEAN_BAF_MAX_FAIL) || Doubles.lessThan(meanBAF(), MEAN_BAF_MIN_FAIL)) { return AmberQCStatus.FAIL; } if (Doubles.greaterThan(contamination(), CONTAMINATION_MAX_FAIL)) { return AmberQCStatus.FAIL; } if (Doubles.greaterThan(meanBAF(), MEAN_BAF_MAX_WARN) || Doubles.lessThan(meanBAF(), MEAN_BAF_MIN_WARN)) { return AmberQCStatus.WARN; } if (Doubles.greaterThan(contamination(), 0)) { return AmberQCStatus.WARN; } return AmberQCStatus.PASS; }  AmberQCStatus status(); abstract double meanBAF(); abstract double contamination();  }
@Test public void testMeanStatus() { assertEquals(FAIL, createWithMean(0.511).status()); assertEquals(WARN, createWithMean(0.510).status()); assertEquals(WARN, createWithMean(0.501).status()); assertEquals(PASS, createWithMean(0.500).status()); assertEquals(PASS, createWithMean(0.487).status()); assertEquals(WARN, createWithMean(0.486).status()); assertEquals(WARN, createWithMean(0.480).status()); assertEquals(FAIL, createWithMean(0.479).status()); }
@Test public void testContaminationStatus() { assertEquals(PASS, createWithContamination(0).status()); assertEquals(WARN, createWithContamination(0.001).status()); assertEquals(WARN, createWithContamination(0.10).status()); assertEquals(FAIL, createWithContamination(0.101).status()); assertEquals(FAIL, createWithContamination(1).status()); }