GenericStack implementation.

Guys its the one we used in DS, just converted to generic type to
enforce type checks, get rid of stacks.
For info:
http://docs.oracle.com/javase/tutorial/java/generics/index.html