Claudenw commented on code in PR #335:
URL:
https://github.com/apache/commons-collections/pull/335#discussion_r998693769
##########
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();
Review Comment:
fixed
##########
src/test/java/org/apache/commons/collections4/bloomfilter/AbstractBitCountProducerTest.java:
##########
@@ -16,35 +16,29 @@
*/
package org.apache.commons.collections4.bloomfilter;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import
org.apache.commons.collections4.bloomfilter.BitCountProducer.BitCountConsumer;
import org.junit.jupiter.api.Test;
public abstract class AbstractBitCountProducerTest extends
AbstractIndexProducerTest {
-
+ /**
+ * A testing BitCountConsumer that always returns true.
+ */
+ private static final BitCountConsumer TRUE_CONSUMER = (i, j) -> true;
/**
* A testing BitCountConsumer that always returns false.
*/
- public static BitCountConsumer FALSE_CONSUMER = new BitCountConsumer() {
-
- @Override
- public boolean test(int index, int count) {
- return false;
- }
- };
+ private static final BitCountConsumer FALSE_CONSUMER = (i, j) -> false;
/**
- * A testing BitCountConsumer that always returns true.
+ * Creates an array of integer pairs comprising the index and the expected
count for the index.
+ * @return an array of integer pairs comprising the index and the expected
count for the index.
*/
- public static BitCountConsumer TRUE_CONSUMER = new BitCountConsumer() {
-
- @Override
- public boolean test(int index, int count) {
- return true;
- }
- };
+ protected abstract int[][] getExpectedBitCount();
Review Comment:
fixed
--
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]