Java sub-typing and generics