You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2022/10/18 09:33:32 UTC

[GitHub] [commons-collections] aherbert commented on a diff in pull request #335: Collections-384: bit count producer operation is not clearly defined

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


##########
src/test/java/org/apache/commons/collections4/bloomfilter/AbstractIndexProducerTest.java:
##########
@@ -93,8 +98,36 @@ int[] toArray() {
      */
     protected abstract int getBehaviour();
 
+    /**
+     * Creates an array of expected indices.
+     * @return an array of expected indices.
+     */
+    protected abstract int[] getExpectedIndices();
+
+    @Test
+    public final void testAsIndexArrayValues() {
+        List<Integer> lst = new ArrayList<>();
+        Arrays.stream(createProducer().asIndexArray()).boxed().forEach( lst::add );
+        for (int i : getExpectedIndices()) {
+            assertTrue( lst.contains(i), "Missing "+i );
+        }
+    }
+
     @Test
     public final void testForEachIndex() {
+        //IndexProducer producer = createProducer();

Review Comment:
   Remove commented out producer



-- 
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-unsubscribe@commons.apache.org

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