Source:
public void testEstimateMinorAlleleFraction() { final SimpleInterval interval = new SimpleInterval("contig", 1, 2); final double tolerance = 0.01; Assert.assertEquals(new AllelicCount(interval, 10, 10).estimateMinorAlleleFraction(), 0.5, tolerance); Assert.assertEquals(new AllelicCount(interval, 12, 19).estimateMinorAlleleFraction(), 0.39936538237877861, tolerance); Assert.assertEquals(new AllelicCount(interval, 40, 12).estimateMinorAlleleFraction(), 0.23076923128457277, tolerance); Assert.assertEquals(new AllelicCount(interval, 53, 67).estimateMinorAlleleFraction(), 0.44744832677710078, tolerance); Assert.assertEquals(new AllelicCount(interval, 55, 45).estimateMinorAlleleFraction(), 0.5, tolerance); Assert.assertEquals(new AllelicCount(interval, 10, 10).estimateMinorAlleleFraction(1.1), 0.5, tolerance); Assert.assertEquals(new AllelicCount(interval, 12, 19).estimateMinorAlleleFraction(1.1), 0.367402, tolerance); Assert.assertEquals(new AllelicCount(interval, 40, 12).estimateMinorAlleleFraction(1.1), 0.248120, tolerance); Assert.assertEquals(new AllelicCount(interval, 53, 67).estimateMinorAlleleFraction(1.1), 0.418562, tolerance); Assert.assertEquals(new AllelicCount(interval, 55, 45).estimateMinorAlleleFraction(1.1), 0.5, tolerance); Assert.assertEquals(new AllelicCount(interval, 10, 10).estimateMinorAlleleFraction(1.5), 0.5, tolerance); Assert.assertEquals(new AllelicCount(interval, 12, 19).estimateMinorAlleleFraction(1.5), 0.296301, tolerance); Assert.assertEquals(new AllelicCount(interval, 40, 12).estimateMinorAlleleFraction(1.5), 0.310345, tolerance); Assert.assertEquals(new AllelicCount(interval, 53, 67).estimateMinorAlleleFraction(1.5), 0.345277, tolerance); Assert.assertEquals(new AllelicCount(interval, 55, 45).estimateMinorAlleleFraction(1.5), 0.482849, tolerance); }

Target:
public void testEstimateMinorAlleleFraction() { final SimpleInterval interval = new SimpleInterval("contig", 1, 2); final double tolerance = 0.005; Assert.assertEquals(new AllelicCount(interval, 10, 10).estimateMinorAlleleFraction(), 0.5, tolerance); Assert.assertEquals(new AllelicCount(interval, 12, 19).estimateMinorAlleleFraction(), 0.39936538237877861, tolerance); Assert.assertEquals(new AllelicCount(interval, 40, 12).estimateMinorAlleleFraction(), 0.23076923128457277, tolerance); Assert.assertEquals(new AllelicCount(interval, 53, 67).estimateMinorAlleleFraction(), 0.44744832677710078, tolerance); Assert.assertEquals(new AllelicCount(interval, 55, 45).estimateMinorAlleleFraction(), 0.5, tolerance); Assert.assertEquals(new AllelicCount(interval, 10, 10).estimateMinorAlleleFraction(1.1), 0.5, tolerance); Assert.assertEquals(new AllelicCount(interval, 12, 19).estimateMinorAlleleFraction(1.1), 0.367402, tolerance); Assert.assertEquals(new AllelicCount(interval, 40, 12).estimateMinorAlleleFraction(1.1), 0.248120, tolerance); Assert.assertEquals(new AllelicCount(interval, 53, 67).estimateMinorAlleleFraction(1.1), 0.418562, tolerance); Assert.assertEquals(new AllelicCount(interval, 55, 45).estimateMinorAlleleFraction(1.1), 0.5, tolerance); Assert.assertEquals(new AllelicCount(interval, 10, 10).estimateMinorAlleleFraction(1.5), 0.5, tolerance); Assert.assertEquals(new AllelicCount(interval, 12, 19).estimateMinorAlleleFraction(1.5), 0.296301, tolerance); Assert.assertEquals(new AllelicCount(interval, 40, 12).estimateMinorAlleleFraction(1.5), 0.310345, tolerance); Assert.assertEquals(new AllelicCount(interval, 53, 67).estimateMinorAlleleFraction(1.5), 0.345277, tolerance); Assert.assertEquals(new AllelicCount(interval, 55, 45).estimateMinorAlleleFraction(1.5), 0.482849, tolerance); }