GridInterpolator2D extends Interpolator2D { @Override public Double interpolate(final Map<Double, Interpolator1DDataBundle> dataBundle, final DoublesPair value) { ArgumentChecker.notNull(value, "value"); ArgumentChecker.notNull(dataBundle, "data bundle"); final Map<Double, Double> xData = new HashMap<>(); for (final Map.Entry<Double, Interpolator1DDataBundle> entry : dataBundle.entrySet()) { xData.put(entry.getKey(), _yInterpolator.interpolate(entry.getValue(), value.getSecond())); } return _xInterpolator.interpolate(_xInterpolator.getDataBundle(xData), value.getFirst()); } GridInterpolator2D(final Interpolator1D xInterpolator, final Interpolator1D yInterpolator);  GridInterpolator2D(final Interpolator1D xInterpolator, final Interpolator1D yInterpolator, final Interpolator1D xExtrapolator, final Interpolator1D yExtrapolator); Map<Double, Interpolator1DDataBundle> getDataBundle(final Map<DoublesPair, Double> data); @Override Double interpolate(final Map<Double, Interpolator1DDataBundle> dataBundle, final DoublesPair value); @Override Map<DoublesPair, Double> getNodeSensitivitiesForValue(final Map<Double, Interpolator1DDataBundle> dataBundle, final DoublesPair value); Interpolator1D getXInterpolator(); Interpolator1D getYInterpolator(); @Override boolean equals(final Object o); @Override int hashCode();  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullDataBundle() { INTERPOLATOR_2D.interpolate(null, DoublesPair.of(2., 4.)); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullValue() { INTERPOLATOR_2D.interpolate(FLAT_DATA_BUNDLE, null); }