### Question:
ExponentialFitter implements DistributionFitter { public static ExponentialFitter create(int numFiniteIntervals, double base, double scale) { checkArgument(numFiniteIntervals > 0, "numFiniteIntervals must be greater than 0"); checkArgument(scale != 0, "scale must not be 0"); checkArgument(base > 1, "base must be greater than 1"); checkDouble(base); checkDouble(scale); ImmutableSortedSet.Builder<Double> boundaries = ImmutableSortedSet.naturalOrder(); for (int i = 0; i < numFiniteIntervals + 1; i++) { boundaries.add(scale * Math.pow(base, i)); } return new AutoValue_ExponentialFitter(base, scale, boundaries.build()); }  static ExponentialFitter create(int numFiniteIntervals, double base, double scale); abstract double base(); abstract double scale(); @Override abstract ImmutableSortedSet<Double> boundaries();  }### Answer:
@Test public void testCreateExponentialFitter_zeroNumIntervals_throwsException() throws Exception { IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> ExponentialFitter.create(0, 3.0, 1.0)); assertThat(thrown).hasMessageThat().contains("numFiniteIntervals must be greater than 0"); }
@Test public void testCreateExponentialFitter_negativeNumIntervals_throwsException() throws Exception { IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> ExponentialFitter.create(-1, 3.0, 1.0)); assertThat(thrown).hasMessageThat().contains("numFiniteIntervals must be greater than 0"); }
@Test public void testCreateExponentialFitter_invalidBase_throwsException() throws Exception { IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> ExponentialFitter.create(3, 0.5, 1.0)); assertThat(thrown).hasMessageThat().contains("base must be greater than 1"); }
@Test public void testCreateExponentialFitter_zeroScale_throwsException() throws Exception { IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> ExponentialFitter.create(3, 2.0, 0.0)); assertThat(thrown).hasMessageThat().contains("scale must not be 0"); }
@Test public void testCreateExponentialFitter_NanScale_throwsException() throws Exception { IllegalArgumentException thrown = assertThrows( IllegalArgumentException.class, () -> ExponentialFitter.create(3, 2.0, Double.NaN)); assertThat(thrown).hasMessageThat().contains("value must be finite, not NaN, and not -0.0"); }