### Question:
MutableDistribution implements Distribution { public void add(double value) { add(value, 1L); } MutableDistribution(DistributionFitter distributionFitter); void add(double value); void add(double value, long numSamples); @Override double mean(); @Override double sumOfSquaredDeviation(); @Override long count(); @Override ImmutableRangeMap<Double, Long> intervalCounts(); @Override DistributionFitter distributionFitter();  }### Answer:
@Test public void testAdd_negativeZero_throwsException() { IllegalArgumentException thrown = assertThrows( IllegalArgumentException.class, () -> distribution.add(Double.longBitsToDouble(0x80000000))); assertThat(thrown).hasMessageThat().contains("value must be finite, not NaN, and not -0.0"); }
@Test public void testAdd_NaN_throwsException() { IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> distribution.add(Double.NaN)); assertThat(thrown).hasMessageThat().contains("value must be finite, not NaN, and not -0.0"); }
@Test public void testAdd_positiveInfinity_throwsException() { IllegalArgumentException thrown = assertThrows( IllegalArgumentException.class, () -> distribution.add(Double.POSITIVE_INFINITY)); assertThat(thrown).hasMessageThat().contains("value must be finite, not NaN, and not -0.0"); }
@Test public void testAdd_negativeInfinity_throwsException() { IllegalArgumentException thrown = assertThrows( IllegalArgumentException.class, () -> distribution.add(Double.NEGATIVE_INFINITY)); assertThat(thrown).hasMessageThat().contains("value must be finite, not NaN, and not -0.0"); }