Claudenw commented on code in PR #481: URL: https://github.com/apache/commons-collections/pull/481#discussion_r1596679002
########## src/main/java/org/apache/commons/collections4/bloomfilter/LayerManager.java: ########## @@ -137,13 +138,13 @@ public static Consumer<LinkedList<BloomFilter>> noCleanup() { * @return A Consumer suitable for the LayerManager {@code cleanup} parameter. * @throws IllegalArgumentException if {@code maxSize <= 0}. */ - public static Consumer<LinkedList<BloomFilter>> onMaxSize(int maxSize) { + public static <T extends BloomFilter> Consumer<List<T>> onMaxSize(int maxSize) { if (maxSize <= 0) { throw new IllegalArgumentException("'maxSize' must be greater than 0"); } return ll -> { while (ll.size() > maxSize) { - ll.removeFirst(); + ll.remove(0); Review Comment: :man_facepalming: @aherbert I finally understand what you were saying. I changed the `LayerManager` to use a `LinkedList` internally, but changed the Cleanup to be defined as `Consumer<Deque<T>>` I think this solves most of the problems. If someone wants to do something weird in the Cleanup they can use the `Collection` or `Iterable` interfaces to navigate. Hopefully the last push solves the issues and we can get this merged. -- 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: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org