// Path: src/main/java/ru/job4j/principle_001/User.java
// public interface User {
//     /**
//      * Name.
//      * @return name of user.
//      */
//     String name();
// 
//     /**
//      * Age.
//      * @return age of user.
//      */
//     int age();
// }


import ru.job4j.principle_001.User;
import java.util.Arrays;
import java.util.List;
import java.util.function.Consumer;
package ru.job4j.principle_003;



/**
 * Example of multiple if-else-throw statements.
 */
public class Credential {

    /**
     * Validations rules.
     */
    private final List<Consumer<User>> validates = Arrays.asList(
            user -> {
                if (!this.checkName(user)) {
                    throw new IllegalStateException("Wrong name.");
                }
            },
            user -> {
                if (!this.checkSurname(user)) {
                    throw new IllegalStateException("Wrong surname.");
                }
            },
            user -> {
// Path: src/main/java/ru/job4j/principle_001/User.java
// public interface User {
//     /**
//      * Name.
//      * @return name of user.
//      */
//     String name();
// 
//     /**
//      * Age.
//      * @return age of user.
//      */
//     int age();
// }


// Path: src/main/java/ru/job4j/principle_003/Credential.java
import ru.job4j.principle_001.User;
import java.util.Arrays;
import java.util.List;
import java.util.function.Consumer;

package ru.job4j.principle_003;



/**
 * Example of multiple if-else-throw statements.
 */
public class Credential {

    /**
     * Validations rules.
     */
    private final List<Consumer<User>> validates = Arrays.asList(
            user -> {
                if (!this.checkName(user)) {
                    throw new IllegalStateException("Wrong name.");
                }
            },
            user -> {
                if (!this.checkSurname(user)) {
                    throw new IllegalStateException("Wrong surname.");
                }
            },
            user -> {
                if (!this.checkBalance(user)) {