code: public <T> Collection<T> getCollection(String prefix, Function<String, T> factory) {
      Collection<T> collection = new ArrayList<>();
      for (String property : properties.stringPropertyNames()) {
        if (property.startsWith(prefix + ".")) {
          collection.add(factory.apply(property));
        }
      }
      return collection;
    }
docs: Reads a collection of properties based on a prefix.
  
  @param prefix The prefix for which to read properties.
  @param factory The factory to call for each property name in the collection.
  @param <T> The collection value type.
  @return The collection.