I actually have this code template configured for my Eclipse. Here you can configure it.
Open the Preferences dialog by going to Windows > Preferences , and then going to Java > Editor > Templates . Click New... here to create a new code template as shown below.

Now, in the Java file editor, select the Object you want to print and press Ctrl + Space .

Call the code template and you get something like
[type] [new_name] = ([type]) new ArrayList<String>();
where [] indicates that the type can be specified using autocomplete.
A default cast template is also available, which can be invoked by typing cast and then pressing Ctrl + Space . The difference is that it does not support selection, but allows you to specify the target using autocomplete. I find both options useful.
[type] [new_name] = ([type]) [name];
source share