Hacker News new | ask | show | jobs
by brunomlopes 6162 days ago
Not only does that require reflection, it is very error prone and not refactor-friendly. Just change the type of the list, change the method, and it will blow up on runtime instead of compile time. In my opinion, that goes against the grain of Java (and c#, in a way) of having the compiler doing a lot of checking for you.

Google's approach, while more verbose, is a bit safer and more idiomatic.