public class TestHasElementsNode extends
TestValueNodeAbstract<HasElementsNode, INode> {
@Override
public void testCalc() {
Node node = getInstance(getA(0));
ValueNode<Integer> res = node.calc(null);
assertTrue(res.getValue().compareTo(1) == 0);
node = getInstance(getA(1));
res = node.calc(null);
assertTrue(res.getValue().compareTo(0) == 0);
node = getInstance(getA(2));
res = node.calc(null);
assertTrue(res.getValue().compareTo(0) == 0);
node = getInstance(getA(3));
res = node.calc(null);
assertTrue(res.getValue().compareTo(1) == 0);
node = getInstance(getA(4));
res = node.calc(null);
assertTrue(res.getValue().compareTo(4) == 0);
node =
getInstance(new ListNode(toList(new MultNode(new ValueNode<>(2),
new ValueNode<>(-2)))));
res = node.calc(null);
assertTrue(res.getValue().compareTo(0) == 0);
node =
getInstance(new ListNode(toList(new MultNode(new ValueNode<>(2),
new ValueNode<>(-2)), new MultNode(new ValueNode<>(2),
new ValueNode<>(-3)), new MultNode(new ValueNode<>(1),
new ValueNode<>(1)))));
res = node.calc(null);
assertTrue(res.getValue().compareTo(1) == 0);
}