FunctionalSurface extends Surface<U, U, V> { @Override public V getZValue(final U x, final U y) { Validate.notNull(x, "x"); Validate.notNull(y, "y"); return _function.evaluate(x, y); } FunctionalSurface(final Function2D<U, V> function); @Override U[] getXData(); @Override U[] getYData(); @Override V[] getZData(); @Override int size(); @Override V getZValue(final U x, final U y); @Override V getZValue(final Pair<U, U> xy);  }
@Test public void test() { double x = 2.1; double y = -6.7; assertEquals(x * y, s_surface.getZValue(x, y), 1e-15); assertEquals(x * y, s_surface.getZValue(DoublesPair.of(x, y)), 1e-15); }