I'm a bit unclear as to why you want to do this...is it just to get rid of the warnings, or do you want more defined compile time type checks? For the former, you can use the @SuppressWarnings...