Merge pull request #3216 from RuiLi8080/STORM-3589

[STORM-3589] Prevent inconsistent results from consecutive hasNext and next calls in LazyNodeSortingIterator