Sprawdź stos pusty java
Stack<String> test = new Stack<String>();
test.push("test1");
if (!test.empty())
{
test.pop();
}
CompSciGeek