Create a public functional interface Validate with a method: public boolean validate name(String name); Create a public
Question:
Create a public functional interface Validate with a method: public boolean validate name(String name); Create a public class ValidateUtility with the below methods: public static Validate validateEmployeeName() – The lambda expression for the validate name method must return true if the name is valid and return false if the name is invalid. In this case, the name is valid if it contains alphabets and space and it should contain a minimum of 5 characters and a maximum of 20 characters. public static Validate validateProductName() – The lambda expression for the validate name method must return true if the name is valid and return false if the name is invalid. In this case, the name is valid if the first character is an alphabet followed by 5 digits. Write the main method in ValidateUtility class. - Get the value for employee name and product name. - Invoke the validateEmployeeName method - Capture the object of Validate returned by the static method. - Invoke the validate name method for the employee name received as input from the user. - Display the result as shown in the sample output. - Next, invoke the validateProductName method - Capture the object of Validate returned by the static method. - Invoke the validate name method for the product name received as input from the user. - Display the result as shown in the sample output. Note: Implement all the static methods mentioned above using a lambda expression. Don’t create an object for the interface using the new keyword.