KroneckerDeltaFunction extends Function2D<Integer, Integer> { @Override public Integer evaluate(Integer i, Integer j) { Validate.notNull(i, "i"); Validate.notNull(j, "j"); return i.intValue() == j.intValue() ? 1 : 0; }  @Override Integer evaluate(Integer i, Integer j);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNull1() { F.evaluate(null, 1); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNull2() { F.evaluate(1, null); }
@Test public void test() { assertEquals(F.evaluate(1, 1).intValue(), 1); assertEquals(F.evaluate(1, 2).intValue(), 0); }