Use lambdas instead of anonymous inner classes.