ArithmeticNode extends AbstractNode<Integer, E> { public static <E> ArithmeticNode<E> create(Operator operator, Node<?, E> lhs, Node<?, E> rhs) throws BindingException { Node<Integer, E> lhsInteger = createIntegerNode(operator, lhs); Node<Integer, E> rhsInteger = createIntegerNode(operator, rhs); return new ArithmeticNode<E>(operator, lhsInteger, rhsInteger); } ArithmeticNode(Operator operator, Node<Integer, E> lhs, Node<Integer, E> rhs); static ArithmeticNode<E> create(Operator operator, Node<?, E> lhs, Node<?, E> rhs); Class<Integer> getType(); Node<Integer, E> simplify(); Node<Integer, E> rescope(ReferenceContext<E> context); Node<Integer, E> getLhs(); Node<Integer, E> getRhs(); Integer eval(E context); void document(Document target); void gather(Set<Reference<E>> references); boolean isParameterized(); @Override boolean isConstantFor(ReferenceContext<E> context);  }
@Test(expected = BindingException.class) public void testAddNonIntegers1() { Node<String, Object> node1 = new StringNode<Object>("Whatever"); Node<Integer, Object> node2 = new IntegerNode<Object>(5); Node<Integer, Object> sum = ArithmeticNode.create(Operator.plus, node1, node2); }
@Test(expected = BindingException.class) public void testAddNonIntegers2() { Node<String, Object> node1 = new StringNode<Object>("Whatever"); Node<Integer, Object> node2 = new IntegerNode<Object>(5); Node<Integer, Object> sum = ArithmeticNode.create(Operator.plus, node2, node1); }