As long as you have a container for your nodes, which is looped though, you should have no problem with NPE's. Your node class makes you able to keep all of your tasks in one list. Makes is easier to manage. So as long as you have a getState in your node class, you should be fine