nodeIsLeaf method
Check if a Node has at least one Relation to it, but none from it.
Implementation
@override
bool nodeIsLeaf(String nodeId) {
return _relations.any((relation) => relation.toNodeId == nodeId) &&
_relations.where((relation) => relation.fromNodeId == nodeId).isEmpty;
}