public static void validate(User user) throws ValidationMovieCatalogException {

        LinkedList<String> errorList = new LinkedList<>();

        if (user == null) {
            errorList.add("Null pointer user");
        } else {
            Pattern pattern = Pattern.compile(LOGIN_PATTERN);
            Matcher matcher = pattern.matcher(user.getLogin());
            if (!matcher.matches()) {
                errorList.add("User's login is not valid. It must match the pattern " + LOGIN_PATTERN);
            }

            pattern = Pattern.compile(PASSWORD_PATTERN);
            matcher = pattern.matcher(user.getPassword());
            if (!matcher.matches()) {
                errorList.add("User's password is not valid. It must match the pattern " + PASSWORD_PATTERN);
            }

            pattern = Pattern.compile(EMAIL_PATTERN);
            matcher = pattern.matcher(user.getEmail());
            if (!matcher.matches()) {
                errorList.add("User's email is not valid. It must match the pattern " + EMAIL_PATTERN);
            }
        }

        if(!errorList.isEmpty()){
            String message = "User validation failed: \n";
            for(String err : errorList){
                message += err + "\n";
            }

            log.error(message);
            throw new ValidationMovieCatalogException(message);
        }
    }