Do Java generics work like that? I thought the JVM did not know about the generics as the types are erased at compile time.
With project Valhalla: https://en.wikipedia.org/wiki/Project_Valhalla_(Java_languag... there's been talk about specialization for value types.
https://adoptopenjdk.gitbooks.io/adoptopenjdk-getting-starte...