First
Code:
Integer *otherInteger = dynamic_cast<Integer&>(anotherNodeItem);
'&' should be '*'
Second, please tell what's the relation between NodeItem and Integer types?