### Question:
UncertaintyAccumulator extends NumberAccumulator { @Override protected void accumulateSample(double sample, double weight) { if (weight != 1.0) { throw new IllegalArgumentException("weight != 1.0"); } sumXX += sample * sample; sampleCount++; }  @Override int getSampleCount(); @Override double combine();  }### Answer:
@Test public void testAccumulateAndCombine_exceptionOnIllegalWeight() { try { accumulator.accumulateSample(1.0, 11.98); fail("IllegalArgumentException expected"); } catch (IllegalArgumentException expected) { } }