protected List<Profile> fetchProfiles(Predicate<Profile> f) {
    initializationGate();
    List<Profile> result = null;
    Profile[] locProfiles = profiles;
    for (Profile profile : locProfiles) {
      if (f == null || f.test(profile)) {
        if (result == null) {
          result = new ArrayList<>(locProfiles.length);
        }
        result.add(profile);
      }
    }

    if (result == null) {
      result = Collections.emptyList();
    } else {
      result = Collections.unmodifiableList(result);
    }

    return result;
  }
Invoke the given {@link ProfileVisitor} on all the {@link Profile}s exiting when the
{@link ProfileVisitor#visit} method returns false. Unlike the {@link #adviseFilter(Predicate)}
method this does assume the return type to be a Set of qualifying members rather allows for
population of an arbitrary aggregator passed as the argument to this method.

@param <T> the type of object used for aggregation of results
@param visitor the {@link ProfileVisitor} to use for the visit
@param aggregate an aggregate object that will be used to for aggregation of results by the
       {@link ProfileVisitor#visit} method; this allows the {@link ProfileVisitor} to not
       maintain any state so that in many situations a global static object encapsulating the
       required behaviour will work

@return true if all the profiles were visited and false if the {@link ProfileVisitor#visit} cut
        it short by returning false
geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionAdvisor.java