Another example of generics with Java