I have List<Product>.
class Product{
String productName;
int mfgYear;
int expYear;
}
int testYear = 2019;
List<Product> productList = getProductList();
I have list of products here.
Have to iterate each one of the Product from the list and get the List<String> productName that lies in the range between mfgYear & expYear for a given 2019(testYear).
For example,
mfgYear <= 2019 <= expYear
How can I write this using Java 8 streams?