Generics in Java - Other languages