Index: src/main/java/org/apache/jackrabbit/commons/JcrUtils.java =================================================================== --- src/main/java/org/apache/jackrabbit/commons/JcrUtils.java (revision 1463897) +++ src/main/java/org/apache/jackrabbit/commons/JcrUtils.java (working copy) @@ -406,6 +406,32 @@ } /** + * Collect all elements from an {@link Iterable} into a {@link List}. + * + * @param iterable The Iterable to collect values from. + * @return The collection result. + */ + public static List collect(Iterable iterable) { + List result = new ArrayList(); + + for (T value : iterable) { + result.add(value); + } + + return result; + } + + /** + * Collect all elements from an {@link Iterator} into a {@link List}. + * + * @param iterator The Iterator to collect values from. + * @return The collection result. + */ + public static List collect(Iterator iterator) { + return collect(in(iterator)); + } + + /** * Returns an {@link Iterable} over the properties of the given node. *

* The first iterator is acquired directly during this method call to