Recommendation system - the main class

We have implemented our algorithm in the ConcurrentMainRecommendation class to obtain the list of recommended products to a customer. This class implements the main() method that receives as a parameter the ID of the customer whose recommended products we want to obtain. We have the following code:

public static void main(String[] args) { 
  String user = args[0]; 
  Path file = Paths.get("data"); 
  try { 
    Date start, end; 
    start=new Date(); 

We have used different streams to transform the data in the final solution. The first one loads the whole list of the Product objects from its files:

List<Product> productList = Files.walk(file, FileVisitOption                                 .FOLLOW_LINKS).parallel().filter(f-> f .toString().endsWith(".txt")) ...

Get Mastering Concurrency Programming with Java 9 - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.