From 0801d0d4ca2ae1c9de9ace2f3b194ca57c26a139 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Sun, 6 Nov 2022 10:46:33 -0500 Subject: [PATCH] Simpler lambdas --- .../collections4/bloomfilter/AbstractBloomFilterTest.java | 4 +--- .../bloomfilter/BitMapProducerFromIndexProducerTest.java | 2 +- .../collections4/bloomfilter/DefaultBloomFilterTest.java | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/test/java/org/apache/commons/collections4/bloomfilter/AbstractBloomFilterTest.java b/src/test/java/org/apache/commons/collections4/bloomfilter/AbstractBloomFilterTest.java index e26be1b51..1098ee492 100644 --- a/src/test/java/org/apache/commons/collections4/bloomfilter/AbstractBloomFilterTest.java +++ b/src/test/java/org/apache/commons/collections4/bloomfilter/AbstractBloomFilterTest.java @@ -143,9 +143,7 @@ public abstract class AbstractBloomFilterTest { for (final long l : values) { lst.add(l); } - assertTrue(f.forEachBitMap(l -> { - return lst.remove(Long.valueOf(l)); - })); + assertTrue(f.forEachBitMap(l -> lst.remove(Long.valueOf(l)))); assertTrue(lst.isEmpty()); } // values too large diff --git a/src/test/java/org/apache/commons/collections4/bloomfilter/BitMapProducerFromIndexProducerTest.java b/src/test/java/org/apache/commons/collections4/bloomfilter/BitMapProducerFromIndexProducerTest.java index bbdeb59f2..3a89b7113 100644 --- a/src/test/java/org/apache/commons/collections4/bloomfilter/BitMapProducerFromIndexProducerTest.java +++ b/src/test/java/org/apache/commons/collections4/bloomfilter/BitMapProducerFromIndexProducerTest.java @@ -55,7 +55,7 @@ public class BitMapProducerFromIndexProducerTest extends AbstractBitMapProducerT public final void testFromIndexProducer() { final List lst = new ArrayList<>(); createProducer().forEachBitMap(lst::add); - final long[] buckets = lst.stream().mapToLong(l -> l.longValue()).toArray(); + final long[] buckets = lst.stream().mapToLong(Long::longValue).toArray(); assertTrue(BitMap.contains(buckets, 0)); assertTrue(BitMap.contains(buckets, 1)); assertTrue(BitMap.contains(buckets, 63)); diff --git a/src/test/java/org/apache/commons/collections4/bloomfilter/DefaultBloomFilterTest.java b/src/test/java/org/apache/commons/collections4/bloomfilter/DefaultBloomFilterTest.java index 802ef3137..869d8d2fc 100644 --- a/src/test/java/org/apache/commons/collections4/bloomfilter/DefaultBloomFilterTest.java +++ b/src/test/java/org/apache/commons/collections4/bloomfilter/DefaultBloomFilterTest.java @@ -103,7 +103,7 @@ public class DefaultBloomFilterTest extends AbstractBloomFilterTest indices.contains(i)); + return indexProducer.forEachIndex(i -> indices.contains(i)); } @Override