The same task as in FunctionObjectRecap repository project, but the code is more concise thanks to lambda expression.