garydgregory commented on a change in pull request #91: Add drain method to 
CollectionUtils
URL: https://github.com/apache/commons-collections/pull/91#discussion_r338850242
 
 

 ##########
 File path: src/main/java/org/apache/commons/collections4/CollectionUtils.java
 ##########
 @@ -909,6 +909,46 @@ public int hashCode() {
         return predicate != null && IterableUtils.matchesAll(input, predicate);
     }
 
+    /**
+     * Removes the specified number of elements from the specified location in 
the collection and returns them.
+     * This method would have the side-effect of modifying the input 
collections.
+     *
+     * @param <E>  the type of object the {@link Collection} contains
+     * @param input  the collection will be operated,can't be null
+     * @param start  the specified position to remove element,can't be less 
than 1
+     * @param count  the specified number to remove,can't be less than 1
+     * @return collection of elements that removed from the input collection
+     */
+    public static <E> Collection<E> drain(Collection<E> input, int start, int 
count) {
 
 Review comment:
   We already have methods named "remove*" in this class and the fact that your 
comments starts with "Removes" shows to me that this method should also be 
prefixed with "remove".

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to