In the life of many developers comes the moment, when you write something non-trivial and it just works. And you don’t have to google anything! It’s quite thrilling!
I have been creating a mock object for testing, that could store several graphs at the same time. The graph was very simple, it could have only root (portfolio) and leaves of several types. Linking was done from leaf to root, by setting two properties (a little redundant): parentId and parentName.