Expected time required: 15 min
In this scenario, you are completing an application that processes users of an online store. New terms and conditions
have been released and you need to check a List of customers to make sure they have accepted these new terms. Write a
lambda expression that implements the Consumer functional interface that consumes an user from a List, and calls
a method to email that user if they have not accepted the new terms. The resource DatabaseManager will handle some
functionality including emailing the specific customers. The method checkCustomers in the class CustomerManager has
some TODO methods for you to complete.
CustomerManagerhas a methodcheckCustomersthat has TODO comments. Using theforEachmethod ofList, use a lambda expression that consumes the items contained in theList. You'll pass the lambda expression as the input argument to theforEachmethod. Implement the lambda expression in-line.DatabaseManagerhas a methodcheckCustomer(String name)that accepts aStringthat is the name of a customer. UseStringsfrom the customersListto send to this method. The method will returntrueif the customer has already accepted the terms and conditions and will returnfalseif they have not accepted the terms and conditions.- If
checkCustomer()returnsfalse, then you must call theDatabaseManagermethodemailCustomer(String name). Call the methodemailCustomer(String name)with the customer name and the resource will handle the rest.
HINTS: