Function2D implements Function<S, T> { @SuppressWarnings("unchecked") @Override public T evaluate(final S... x) { ArgumentChecker.noNulls(x, "parameter list"); ArgumentChecker.isTrue(x.length == 2, "parameter list must be of length 2"); return evaluate(x[0], x[1]); }  @SuppressWarnings("unchecked") @Override T evaluate(final S... x); abstract T evaluate(S x1, S x2);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullArray() { F.evaluate((Double[]) null); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testEmptyArray() { F.evaluate(new Double[0]); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testShortArray() { F.evaluate(new Double[] {1.}); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullFirst() { F.evaluate(new Double[] {null, 1.}); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullSecond() { F.evaluate(new Double[] {1., null}); }