Refactoring a method that relies on a loop

Viewed 278

My java code below increments an int value depending on how many dogs in a list are over a certain age:

for (int i = 0; i < dogList.size(); i++) {
    if (dogList.get(i).getAge() > 5) {
        dogsOverFive++
        continue;
    }           
}

What would be best practice for refactoring my code into its own method?
Should I pass i and the list as a parameter?

2 Answers
Related