Source:
<code>public void testEstimateMinorAlleleFraction() { final SimpleInterval interval = new SimpleInterval("contig", 1, 2); <START> final double tolerance = 0.01; <END> 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); }</code><technical_language>I want choose a slightly smaller tolerance (0.001-0.005 is fine, I think). 0.0001 overkill though..</technical_language>

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); }