input: Write a python function to traverse a binary tree in in-order using an iterator class.
  assert inorder_traversal(TreeNode(1, TreeNode(2), TreeNode(3))) == [2, 1, 3]
  assert inorder_traversal(TreeNode(4, TreeNode(2, TreeNode(1), TreeNode(3)), TreeNode(6, TreeNode(5), TreeNode(7)))) == [1, 2, 3, 4, 5, 6, 7]
  assert inorder_traversal(TreeNode(1)) == [1]
output: class TreeNode:
      def __init__(self, val=0, left=None, right=None):
          self.val = val
          self.left = left
          self.right = right
  
  class InOrderIterator:
      def __init__(self, root):
          self.stack = []
          self._push_left(root)
      
      def _push_left(self, node):
          while node:
              self.stack.append(node)
              node = node.left
  
      def has_next(self):
          return len(self.stack) > 0
      
      def next(self):
          if not self.has_next():
              raise StopIteration
          node = self.stack.pop()
          result = node.val
          if node.right:
              self._push_left(node.right)
          return result
  
  def inorder_traversal(root):
      result = []
      iterator = InOrderIterator(root)
      while iterator.has_next():
          result.append(iterator.next())
      return result