DiracDeltaFunction extends Function1D<Double, Double> { @Override public Double evaluate(final Double x) { Validate.notNull(x, "x"); return CompareUtils.closeEquals(x, 0, 1e-16) ? Double.POSITIVE_INFINITY : 0; }  @Override Double evaluate(final Double x);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNull() { F.evaluate((Double) null); }
@Test public void test() { assertEquals(Double.POSITIVE_INFINITY, F.evaluate(0.), 0); assertEquals(Double.POSITIVE_INFINITY, F.evaluate(1e-20), 0); assertEquals(Double.POSITIVE_INFINITY, F.evaluate(-1e-20), 0); assertEquals(0, F.evaluate(1e-15), 0); assertEquals(0, F.evaluate(-1e-15), 0); }