Java generics are horrible