How to implement Stack Iteration using Java 8 Stream
<p>I have a <code>Stack&lt;Object&gt;</code> and following piece of code:</p>

<pre><code>while(!stack.isEmpty()){
    Object object = stack.pop();
    // do some operation on object
}
</code></pre>

<p>How this iteration can be implemented using Java 8 Stream so that it loops until the stack is empty and in every iteration the stack should be reduce by popping one element from top?</p>