define "best": your implementation seems fine, what are you looking for?
The only thing that's weird is that you Core.instantiate an empty object, I believe you can remove that and replace
IMendixObject obj_output=Core.instantiate(getContext(),"MyFirstModule.test");
obj_output=list_input.get(i).getMendixObject();
directly with
IMendixObject obj_output=list_input.get(i).getMendixObject();
I also believe that you don't use the context you create a var for at line 1:
IContext context=getContext();