switch lambdas to inner classes because checkstyle

graded using older checkstyle