Utility method that allows for a basic for-loop using lambdas.