implemented averageSum test using lambda expression and method reference