### Question:
DoubleStat { Double getSum() { if (count == 0) { return null; } double tmp = sum + sumCompensation; if (Double.isNaN(tmp) && Double.isInfinite(simpleSum)) { return simpleSum; } else { return tmp; } }    }### Answer:
@Test public void testEmptySum() { DoubleStat sum = new DoubleStat(); assertNull(sum.getSum()); }