I am new to Eclipse which I use primarily for Java. I have previously used IntelliJ Idea in which it is possible to select a variable which extends Iteratable (Collection, List
You probably cannot do that in eclipse, but type for and hit Ctrl-Space twice you will see the code templates menu pop up. Then you could select functionWhichReturnsList() in proper place and eclipse will do the rest.