All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aaronbedra.password.traits.AtLeastOneLower Maven / Gradle / Ivy

package com.aaronbedra.password.traits;

import com.jnape.palatable.traitor.traits.Trait;

import static org.junit.Assert.assertTrue;

public class AtLeastOneLower implements Trait {
    @Override
    public void test(String s) {
        boolean hasOne = false;
        for (char c : s.toCharArray()) {
            if (Character.isLowerCase(c)) {
                hasOne = true;
            }
        }

        assertTrue(s + " does not have at least one lower case character", hasOne);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy