@Override
  public TreeNode<T> next() throws NoSuchElementException {
    if (pathStack.isEmpty()) {
      throw new NoSuchElementException();
    }
    var next = pathStack.pop();
    pushPathToNextSmallest(next.getRight());
    return next;
  }
@Test
  void nextOverEntirePopulatedTree() {
    var iter = new BstIterator<>(nonEmptyRoot);
    assertEquals(Integer.valueOf(1), iter.next().getVal(), "First Node is 1.");
    assertEquals(Integer.valueOf(3), iter.next().getVal(), "Second Node is 3.");
    assertEquals(Integer.valueOf(4), iter.next().getVal(), "Third Node is 4.");
    assertEquals(Integer.valueOf(5), iter.next().getVal(), "Fourth Node is 5.");
    assertEquals(Integer.valueOf(6), iter.next().getVal(), "Fifth Node is 6.");
    assertEquals(Integer.valueOf(7), iter.next().getVal(), "Sixth Node is 7.");
  }