something like this?

http://www.java2s.com/Code/Java/Coll...stopostfix.htm