I'm implementing a generi method that's supposed to traverse a binary tree in PostOrder but when I attempt to use it, the Iterator doesn't work as It should when I attempt to use ot on a Binary Tree, can anyone spot my mistake in the code? Thanks.

The method makes use of a generic POIterator class which implements a generic Iterator<T>

here's th POIterator class

public class POIterator<T> implements Iterator<T>{
Deque<BNode<E>>someStack = new LinkedList<BNNode<E>>();
BNode<E> position;

public T next(){
    position = position.pop();
        return position.getInfo();
            position = position.getLeftNode();
        next();//recurisive call
        position = position.pop();
            next();//recursive call 
}//end of next() method;

I have a getPOIterator method in some other class.
When I run tests to check my POIterator method, it doesn't work well/asits supposed to.
Can anyone find anything wrong wuth my POIterator code?

"it doesn't work well/as it's supposed to"
what does it do, and how is it supposed to work according to you?

This question has already been answered. Start a new discussion instead.