Add Null Object pattern for Heap Nodes. Change HeapNode class to ValuedHeapNode. Add new Abstract class HeapNode. Add new NullHeapNode class extending HeapNode. Change ValuedHeapNode class to extend HeapNode. Replace various try/catch blocks to take advantage of Null Object pattern.