See the following image:

I pass an Object and check if it is a JPanel. Inside the if block I get all the methods of JPanel when I query for available methods on o.
And now see the result when I check a method:

Eclipse automatically created the cast to JPanel and added the method call. Pretty impressive how intelligent the autocompletion of Eclipse got.