ExponentialInterpolator1D extends Interpolator1D { @Override public Double interpolate(final Interpolator1DDataBundle data, final Double value) { Validate.notNull(value, "value"); Validate.notNull(data, "data bundle"); InterpolationBoundedValues boundedValues = data.getBoundedValues(value); Double x1 = boundedValues.getLowerBoundKey(); Double y1 = boundedValues.getLowerBoundValue(); if (boundedValues.getLowerBoundIndex() == data.size() - 1) { return y1; } Double x2 = boundedValues.getHigherBoundKey(); Double y2 = boundedValues.getHigherBoundValue(); return Math.pow(y2 / y1, (value - x1) / (x2 - x1)) * y1; }  @Override Double interpolate(final Interpolator1DDataBundle data, final Double value); @Override double firstDerivative(final Interpolator1DDataBundle data, final Double value); @Override Interpolator1DDataBundle getDataBundle(final double[] x, final double[] y); @Override Interpolator1DDataBundle getDataBundleFromSortedArrays(final double[] x, final double[] y); @Override double[] getNodeSensitivitiesForValue(Interpolator1DDataBundle data, Double value);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullDataBundle() { INTERPOLATOR.interpolate(null, 2.); }