title: Combining two activity classes when activity type is same using java streams
body: <p>I have list of activities for a day. I would like to merge two consecutive activities if the type of activity is same ( example resting). How can i do this using streams??</p>