Note that this doesn't change runtime from $O(N)$ to $O(N \log N)$ (or worse)
(if that is your concern Andrew, I had to convince myself!) because we aren't
sorting the whole list, we are just finding the max.

No, I was indeed thinking about more about the need to introduce new concepts. From your description and a more detailed look at the code [1], it looks like this is mainly a matter of exposing an existing implementation choice. Good to know it won't change the runtime, too.

Since ordering seems very much an internal implementation detail right now, do we think it makes sense to expose that and then basically force the implementation to always choose it's result value through a sorting/ordering process in future?

Or would it make sense to allow users to control the choice process *explicitly* by providing a Function<Iterable<? extends Image>, Image>. This would seems to be a little closer to the functional interface we're looking for here..?

ap

[1] https://github.com/jclouds/jclouds/blob/master/compute/src/main/java/org/jclouds/compute/domain/internal/TemplateBuilderImpl.java#L802

Reply via email to