aherbert commented on code in PR #331:
URL: 
https://github.com/apache/commons-collections/pull/331#discussion_r955784220


##########
src/test/java/org/apache/commons/collections4/bloomfilter/AbstractBloomFilterTest.java:
##########
@@ -62,49 +62,34 @@ protected final Shape getTestShape() {
      */
     protected abstract T createEmptyFilter(Shape shape);
 
-    /**
-     * Create the BloomFilter implementation we are testing.
-     *
-     * @param shape the shape of the filter.
-     * @param hasher the hasher to use to create the filter.
-     * @return a BloomFilter implementation.
-     */
-    protected abstract T createFilter(Shape shape, Hasher hasher);

Review Comment:
   This is a common pattern for _testing_.
   
   Out of curiosity I would ask you to search your use cases in your own 
production code to see how often you create a filter and then add only item 
immediately.
   
   I would think this is equivalent to having an ArrayList constructor that 
adds 1 item. This is not in the JDK. There are better alternatives for such a 
case such as a singleton list or using Arrays.asList.
   
   On top of this the item you are adding will require some source of indices 
(e.g. a Hasher, another filter, etc). So there will already be some lines of 
code to create that from the actual Object, or collection of Objects, that are 
being used to initialise the filter. 
   
   If you find use cases for this then we can add a more suitable functionality 
in later releases, or perhaps this exact functionality. For now the purpose is 
to reduce the initial public API to a manageable release and then receive 
feedback from the community on what features to enhance.



-- 
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]

Reply via email to