Also I am curious, why do you want to come up with such a method in the first place ?
The only reason that I am making this is, because example in book I'm reading was not interesting for me (Core Java I by Cay Horstmann, Chapter 5). Also I found that making by myself is optimal way to imagine how features work.
This function is first idea that hit my head. Also maybe after extending it it might be useful for debugging purposes - I could pass for example collection of arguments, collection of functions and return collection of output from them. But I'm not really sure -I am just Java greenhorn (I think so).
So what would be remedy for not being able to use primitive types? The only thing that comes to my mind is to convert wrappers inside function to primitive types, but it feels like chore.
Also for answer with usage of streams - this is currently ahead of me. I want to use things, that I put into practice so my view of whole core functionalities in Java will be structured.
However it looks like nice hack indeed.