Java generics runtime resolver