public class TestTailNode extends TestValueNodeAbstract<TailNode, INode> {
@SuppressWarnings("unchecked")
@Override
public void testCalc() {
INode node = getInstance(getA(0));
ListNode res = node.calc(null);
List<INode> resList = res.getValue();
assertTrue(resList.size() == 0);
node = getInstance(getA(3));
res = node.calc(null);
resList = res.getValue();
assertTrue(resList.size() == 1);
assertTrue(((ValueNode<Double>) resList.get(0)).getValue().compareTo(2.0) == 0);
node =
getInstance(new ListNode(toList(new MultNode(new ValueNode<>(2),
new ValueNode<>(-2.)))));
res = node.calc(null);
resList = res.getValue();
assertTrue(resList.size() == 0);
node =
getInstance(new ListNode(toList(new MultNode(new ValueNode<>(2),
new ValueNode<>(-2.)), new MultNode(new ValueNode<>(2),
new ValueNode<>(-3.)))));
res = node.calc(null);
resList = res.getValue();
assertTrue(resList.size() == 1);
assertTrue(((ValueNode<Double>) resList.get(0)).getValue().compareTo(-6.0) == 0);
}