public class TestListNode extends TestValueNodeAbstract<ListNode, List<INode>> {
@SuppressWarnings("unchecked")
@Override
public void testCalc() {
Node node = getInstance(getA(0));
ListNode res = node.calc(null);
List<INode> resList = res.getValue();
assertTrue(((ValueNode<Integer>) resList.get(0)).getValue().compareTo(1) == 0);
node = getInstance(getA(1));
res = node.calc(null);
resList = res.getValue();
assertTrue(((ValueNode<Integer>) resList.get(0)).getValue().compareTo(-1) == 0);
node = getInstance(getA(2));
res = node.calc(null);
resList = res.getValue();
assertTrue(((ValueNode<Integer>) resList.get(0)).getValue().compareTo(0) == 0);
node = getInstance(getA(3));
ListNode res2 = node.calc(null);
resList = res2.getValue();
assertTrue(((ValueNode<Double>) resList.get(0)).getValue().compareTo(1.) == 0);
node = getInstance(getA(4));
res2 = node.calc(null);
resList = res2.getValue();
assertTrue(((ValueNode<Double>) resList.get(0)).getValue().compareTo(-1.) == 0);
node = getInstance(getA(5));
res2 = node.calc(null);
resList = res2.getValue();
assertTrue(((ValueNode<Double>) resList.get(0)).getValue().compareTo(0.) == 0);
node =
getInstance(toList(new MultNode(new ValueNode<>(2),
new ValueNode<>(-2.))));
res2 = node.calc(null);
resList = res2.getValue();
assertTrue(((ValueNode<Double>) resList.get(0)).getValue().compareTo(-4.) == 0);
node =
getInstance(toList(new MultNode(new ValueNode<>(2),
new ValueNode<>(-2.)), new MultNode(new ValueNode<>(2),
new ValueNode<>(-3.))));
res2 = node.calc(null);
resList = res2.getValue();
assertTrue(((ValueNode<Double>) resList.get(0)).getValue().compareTo(-4.) == 0);
assertTrue(((ValueNode<Double>) resList.get(1)).getValue().compareTo(-6.) == 0);
}