package org.stepic.droid.util;

public class ValidatorUtil {
    public static final int MIN_PASSWORD_LENGTH = 6;

    public static boolean isPasswordValid(String password) {
        return password != null && password.length() >= MIN_PASSWORD_LENGTH;
    }

    public static boolean isPasswordLengthValid(int passwordLength){
        return passwordLength >= MIN_PASSWORD_LENGTH;
    }

}
@@ -25,16 +25,125 @@
 .util;%0A%0A
+import org.jetbrains.annotations.Nullable;%0A%0Aimport java.util.regex.Matcher;%0Aimport java.util.regex.Pattern;%0A%0A
 public c
@@ -429,16 +429,17 @@
 dLength)
+ 
 %7B%0A      
@@ -493,9 +493,395 @@
 %0A    %7D%0A%0A
+    public static boolean isEmailValid(@Nullable String email) %7B%0A        if (email == null %7C%7C email.isEmpty()) return false;%0A        String regex = %22%5E%5B%5C%5Cw!#$%25&'*+/=?%60%7B%7C%7D~%5E-%5D+(?:%5C%5C.%5B%5C%5Cw!#$%25&'*+/=?%60%7B%7C%7D~%5E-%5D+)*@(?:%5Ba-zA-Z0-9-%5D+%5C%5C.)+%5Ba-zA-Z%5D%7B2,6%7D$%22;%0A        Pattern pattern = Pattern.compile(regex);%0A        Matcher matcher = pattern.matcher(email);%0A        return matcher.matches();%0A    %7D%0A%0A
 %7D

add e-mail validator