mimaison commented on code in PR #14856:
URL: https://github.com/apache/kafka/pull/14856#discussion_r1457296352


##########
clients/src/main/java/org/apache/kafka/common/utils/Utils.java:
##########
@@ -1492,6 +1501,20 @@ public static <E> Set<E> diff(final Supplier<Set<E>> 
constructor, final Set<E> l
         return result;
     }
 
+    /**
+     * @param set Source set.
+     * @param toRemove Elements to remove.
+     * @return {@code set} copy without {@code toRemove} elements.
+     * @param <T> Element type.
+     */
+    @SuppressWarnings("unchecked")
+    public static <T> Set<T> minus(Set<T> set, T...toRemove) {

Review Comment:
   Let's not add methods in the client module that are only used in tools. This 
can be moved to ToolsUtils.



##########
clients/src/main/java/org/apache/kafka/common/utils/Utils.java:
##########
@@ -594,6 +594,15 @@ public static <T> String join(T[] strs, String separator) {
         return join(Arrays.asList(strs), separator);
     }
 
+    /**
+     * Create a string representation of a collection joined by ", ".
+     * @param collection The list of items
+     * @return The string representation.
+     */
+    public static <T> String join(Collection<T> collection) {

Review Comment:
   Do we really need this method? Why can't we call the existing `join()` 
method and pass the separator? If you want to keep it, since it's only used in 
tools let's move it to the tools module.



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to