Stream API (introduced in Java 8) is used to process collections of data in a functional and declarative way.
//Use three pointers and so you can change the next of the mid to the first one without losing the track of the original left.