A DESCRIPTION OF THE REQUEST :
Although generics have reduced the need for casting there are still occasions where you need to do it. A cast method that uses type argument inference would make casting much easier.
So if this method existed in Object :
@SuppressWarnings("unchecked")
public <T> T cast()
{
return (T)this;
}
then most casts would be simplified to
// very contrived example
Object o = new MyType();
MyType myObject = o.cast();
instead of the current
MyType myObject = (MyType)o;
JUSTIFICATION :
This means less code to type and read. That has to be good!