reschke commented on code in PR #1690:
URL: https://github.com/apache/jackrabbit-oak/pull/1690#discussion_r1749947180
##########
oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/collections/CollectionUtils.java:
##########
@@ -81,4 +83,69 @@ public static <T> Set<T> toSet(final Iterator<T> iterator) {
return result;
}
-}
+ /**
+ * Convert a vararg list of items to a set. The returning set is mutable
and supports all optional operations.
+ * @param elements elements to convert
+ * @return the set
+ * @param <T> the type of the elements
+ */
+ @SafeVarargs
+ public static <T> Set<T> toSet(final T... elements) {
+ final Set<T> result = new HashSet<>(elements.length);
Review Comment:
or specify the load factor as 1?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]