<@U3KRGN7GS> Notice that these four snippets of co...
# random
c
@nounours Notice that these four snippets of code defer by just one line: extracting a
String
from the passed object. With that in mind, I would create a function that receives this operation as parameter closure
(T -> String)
. Then you invoke it either passing
{ it -> it.toString()}
or
{it -> it.getName() }
.