Drop the temp!
In classic Java, it is a common idiom to set up a temp variable to hold some value, populate it in a for loop (often after checking some condition for values to add), and then subsequently return the temp variable: public List<Person> getFilteredUsers(List<Person>…