public Pet getPet(String name, boolean ignoreNew) {
        name = name.toLowerCase();
        for (Pet pet : getPetsInternal()) {
            if (!ignoreNew || !pet.isNew()) {
                String compName = pet.getName();
                compName = compName.toLowerCase();
                if (compName.equals(name)) {
                    return pet;
                }
            }
        }
        return null;
    }
Return the Pet with the given name, or null if none found for this Owner.

@param name to test
@return true if pet name is already in use
src/main/java/org/springframework/samples/petclinic/model/Owner.java