JAVA 9 takeWhile and doWhile

Trying to get my hands wet with Java 9. Looks like the streams have got another round of good method updates. Here in this gist we are trying to demonstrate the takeWhile and the dropWhile filter in the Java 9.

takeWhile method

Operates on a stream and in the code, we are trying to identify the songs that were from the year that is less than 2002. This condition qualifies only one record to be returned. The returned data is

2000 VENILAVE

dropWhile method

Aging this operates on a stream as well, and this one returns all the records whose album year is after 2002. So the we get back the following records.

1: https://gist.github.com/sathishjayapal/42b646b07f79b3e697909149ea27ae1f"https://gist.github.com/sathishjayapal/42b646b07f79b3e697909149ea27ae1f.js">

2002 VA VA VASANTHAME

2010 VANJOKOTIYA

2008 SEMMAFIGURE

2001 ARABIC KADLORAM

1995 ANJALI ANJALI

2010 PEN ALLA PEN ALLA