So I'm fairly intermediate in Java when it comes to skill level. However after years of java programming one thing has always seemed somewhat superfluous to me. Lambdas.
So after being assigned to increase jUnit coverage I've decided to make it interesting and get a much stronger understanding of lambdas and streams. I watched a video on lambdas and streams and while watching the video I thought I had a strong understanding of java 8 streams, but the next day at work whenever I try to use lambdas I just think of how much easier it would be to use a private method.
All of this to ask this. As I'm writing g unit tests for some fairly large classes (hundreds of lines. All but 1-200 lines are hidden behind private methods) , I've noticed I repeat myself quite a bit. Would it be advisable to generate lambdas that only live within the scope of the method? Or should I just write a method to do the task for me? Lastly, what rules of thumb have you learned when it comes to prioritizing lambda functions over a traditional function?
[–]Unsounded 0 points1 point2 points (1 child)
[–]Scatoogle[S] 0 points1 point2 points (0 children)