Solution to problem 1 using java 8.
Solution to problem 2 using java 8.
Solution to problem 3 using java 8.
Solution to problem 4 using java 8.