[java] Null<Something> gets inferred as Something. Temp fix for #3332