You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2020/02/17 14:10:35 UTC
[commons-collections] 05/12: Remove whitespace around parentheses.
This is an automated email from the ASF dual-hosted git repository.
aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-collections.git
commit 5f7094857020a308ae494422eecb026e8a5252da
Author: aherbert <a....@sussex.ac.uk>
AuthorDate: Mon Feb 17 13:17:11 2020 +0000
Remove whitespace around parentheses.
---
.../bloomfilter/CountingBloomFilter.java | 18 +--
.../bloomfilter/hasher/HashFunctionIdentity.java | 2 +-
.../hasher/HashFunctionIdentityImpl.java | 4 +-
.../collections4/bloomfilter/hasher/Shape.java | 2 +-
.../bloomfilter/CountingBloomFilterTest.java | 158 ++++++++++-----------
.../bloomfilter/SetOperationsTest.java | 8 +-
.../bloomfilter/hasher/StaticHasherTest.java | 6 +-
7 files changed, 99 insertions(+), 99 deletions(-)
diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/CountingBloomFilter.java b/src/main/java/org/apache/commons/collections4/bloomfilter/CountingBloomFilter.java
index ed872e2..b1437cb 100644
--- a/src/main/java/org/apache/commons/collections4/bloomfilter/CountingBloomFilter.java
+++ b/src/main/java/org/apache/commons/collections4/bloomfilter/CountingBloomFilter.java
@@ -102,8 +102,8 @@ public class CountingBloomFilter extends AbstractBloomFilter {
@Override
public int andCardinality(final BloomFilter other) {
if (other instanceof CountingBloomFilter) {
- final Set<Integer> result = new HashSet<>( counts.keySet());
- result.retainAll( ((CountingBloomFilter)other).counts.keySet() );
+ final Set<Integer> result = new HashSet<>(counts.keySet());
+ result.retainAll(((CountingBloomFilter)other).counts.keySet());
return result.size();
}
return super.andCardinality(other);
@@ -172,8 +172,8 @@ public class CountingBloomFilter extends AbstractBloomFilter {
@Override
public void merge(final Hasher hasher) {
- verifyHasher( hasher );
- merge( hasher.getBits(getShape()) );
+ verifyHasher(hasher);
+ merge(hasher.getBits(getShape()));
}
/**
@@ -186,9 +186,9 @@ public class CountingBloomFilter extends AbstractBloomFilter {
if (val == null) {
counts.put(idx, 1 );
} else if (val == Integer.MAX_VALUE) {
- throw new IllegalStateException( "Overflow on index "+idx);
+ throw new IllegalStateException("Overflow on index " + idx);
} else {
- counts.put( idx, val+1 );
+ counts.put(idx, val + 1);
}
});
}
@@ -223,9 +223,9 @@ public class CountingBloomFilter extends AbstractBloomFilter {
* @param hasher the hasher to generate bits.
*/
public void remove(final Hasher hasher) {
- verifyHasher( hasher );
+ verifyHasher(hasher);
final Set<Integer> lst = new HashSet<>();
- hasher.getBits(getShape()).forEachRemaining( (Consumer<Integer>)lst::add );
+ hasher.getBits(getShape()).forEachRemaining((Consumer<Integer>)lst::add);
remove(lst.stream());
}
@@ -245,7 +245,7 @@ public class CountingBloomFilter extends AbstractBloomFilter {
}
}
if (val == null || val == 0) {
- throw new IllegalStateException( "Underflow on index "+idx);
+ throw new IllegalStateException("Underflow on index " + idx);
} else if (val - 1 == 0) {
counts.remove(idx);
} else {
diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/HashFunctionIdentity.java b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/HashFunctionIdentity.java
index 65383e1..00170e0 100644
--- a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/HashFunctionIdentity.java
+++ b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/HashFunctionIdentity.java
@@ -106,7 +106,7 @@ public interface HashFunctionIdentity {
*/
static byte[] prepareSignatureBuffer(final HashFunctionIdentity identity) {
- return String.format( "%s-%s-%s",
+ return String.format("%s-%s-%s",
identity.getName().toUpperCase(Locale.ROOT), identity.getSignedness(),
identity.getProcessType() ).getBytes(StandardCharsets.UTF_8);
diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/HashFunctionIdentityImpl.java b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/HashFunctionIdentityImpl.java
index a0a047b..5a55f1b 100644
--- a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/HashFunctionIdentityImpl.java
+++ b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/HashFunctionIdentityImpl.java
@@ -35,7 +35,7 @@ public final class HashFunctionIdentityImpl implements HashFunctionIdentity {
* Creates a copy of the HashFunctionIdentity.
* @param identity the identity to copy.
*/
- public HashFunctionIdentityImpl( final HashFunctionIdentity identity) {
+ public HashFunctionIdentityImpl(final HashFunctionIdentity identity) {
this.name = identity.getName();
this.provider = identity.getProvider();
this.signedness = identity.getSignedness();
@@ -51,7 +51,7 @@ public final class HashFunctionIdentityImpl implements HashFunctionIdentity {
* @param process the processes of the hash function.
* @param signature the signature for the hash function.
*/
- public HashFunctionIdentityImpl( final String provider, final String name, final Signedness signedness, final ProcessType process,
+ public HashFunctionIdentityImpl(final String provider, final String name, final Signedness signedness, final ProcessType process,
final long signature) {
this.name = name;
this.provider = provider;
diff --git a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/Shape.java b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/Shape.java
index f5a1e45..b3ac6ed 100644
--- a/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/Shape.java
+++ b/src/main/java/org/apache/commons/collections4/bloomfilter/hasher/Shape.java
@@ -261,7 +261,7 @@ public class Shape {
return
other.getNumberOfBits() == getNumberOfBits() &&
other.getNumberOfHashFunctions() == getNumberOfHashFunctions() &&
- HashFunctionIdentity.COMMON_COMPARATOR.compare( getHashFunctionIdentity(),
+ HashFunctionIdentity.COMMON_COMPARATOR.compare(getHashFunctionIdentity(),
other.getHashFunctionIdentity()) == 0;
}
return false;
diff --git a/src/test/java/org/apache/commons/collections4/bloomfilter/CountingBloomFilterTest.java b/src/test/java/org/apache/commons/collections4/bloomfilter/CountingBloomFilterTest.java
index 991ef01..c59dd9b 100644
--- a/src/test/java/org/apache/commons/collections4/bloomfilter/CountingBloomFilterTest.java
+++ b/src/test/java/org/apache/commons/collections4/bloomfilter/CountingBloomFilterTest.java
@@ -44,26 +44,26 @@ public class CountingBloomFilterTest extends AbstractBloomFilterTest {
*/
@Test
public void andCardinalityTest_CountingBloomFilter() {
- final Hasher hasher = new StaticHasher( Arrays.asList( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ).iterator(), shape );
+ final Hasher hasher = new StaticHasher(Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10).iterator(), shape);
final CountingBloomFilter bf = createFilter(hasher, shape);
- Hasher hasher2 = new StaticHasher( Arrays.asList( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ).iterator(), shape );
+ Hasher hasher2 = new StaticHasher(Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10).iterator(), shape);
CountingBloomFilter bf2 = createFilter(hasher2, shape);
- assertEquals( 10, bf.andCardinality(bf2));
- assertEquals( 10, bf2.andCardinality(bf));
+ assertEquals(10, bf.andCardinality(bf2));
+ assertEquals(10, bf2.andCardinality(bf));
- hasher2 = new StaticHasher( Arrays.asList( 1, 2, 3, 4, 5 ).iterator(), shape );
+ hasher2 = new StaticHasher(Arrays.asList(1, 2, 3, 4, 5).iterator(), shape);
bf2 = createFilter(hasher2, shape);
- assertEquals( 5, bf.andCardinality(bf2));
- assertEquals( 5, bf2.andCardinality(bf));
+ assertEquals(5, bf.andCardinality(bf2));
+ assertEquals(5, bf2.andCardinality(bf));
- hasher2 = new StaticHasher( Arrays.asList( 11, 12, 13, 14, 15 ).iterator(), shape );
+ hasher2 = new StaticHasher(Arrays.asList(11, 12, 13, 14, 15).iterator(), shape);
bf2 = createFilter(hasher2, shape);
- assertEquals( 0, bf.andCardinality(bf2));
- assertEquals( 0, bf2.andCardinality(bf));
+ assertEquals(0, bf.andCardinality(bf2));
+ assertEquals(0, bf2.andCardinality(bf));
}
@@ -73,8 +73,8 @@ public class CountingBloomFilterTest extends AbstractBloomFilterTest {
*/
@Test
public void ConstructorTest_HasherValues_CountsTest() {
- final List<Integer> lst = Arrays.asList( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 );
- final Hasher hasher = new StaticHasher( lst.iterator(), shape );
+ final List<Integer> lst = Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+ final Hasher hasher = new StaticHasher(lst.iterator(), shape);
final CountingBloomFilter bf = createFilter(hasher, shape);
final long[] lb = bf.getBits();
@@ -95,15 +95,15 @@ public class CountingBloomFilterTest extends AbstractBloomFilterTest {
final Map<Integer,Integer> map = new HashMap<>();
for (int i =0;i<17;i++)
{
- map.put( i, 1 );
+ map.put(i, 1);
}
- CountingBloomFilter bf = new CountingBloomFilter( map, shape);
+ CountingBloomFilter bf = new CountingBloomFilter(map, shape);
assertEquals(17, bf.getCounts().count());
- map.put( shape.getNumberOfBits(), 1 );
+ map.put(shape.getNumberOfBits(), 1);
try {
- bf = new CountingBloomFilter( map, shape);
+ bf = new CountingBloomFilter(map, shape);
fail("Should have thrown IllegalArgumentExceptionW");
} catch (final IllegalArgumentException exprected)
{
@@ -111,9 +111,9 @@ public class CountingBloomFilterTest extends AbstractBloomFilterTest {
}
map.clear();
- map.put( -1, 1 );
+ map.put(-1, 1);
try {
- bf = new CountingBloomFilter( map, shape);
+ bf = new CountingBloomFilter(map, shape);
fail("Should have thrown IllegalArgumentExceptionW");
} catch (final IllegalArgumentException exprected)
{
@@ -121,9 +121,9 @@ public class CountingBloomFilterTest extends AbstractBloomFilterTest {
}
map.clear();
- map.put( 1, -1 );
+ map.put(1, -1);
try {
- bf = new CountingBloomFilter( map, shape);
+ bf = new CountingBloomFilter(map, shape);
fail("Should have thrown IllegalArgumentExceptionW");
} catch (final IllegalArgumentException exprected)
{
@@ -134,12 +134,12 @@ public class CountingBloomFilterTest extends AbstractBloomFilterTest {
@Override
protected CountingBloomFilter createEmptyFilter(final Shape shape) {
- return new CountingBloomFilter( shape );
+ return new CountingBloomFilter(shape);
}
@Override
protected CountingBloomFilter createFilter(final Hasher hasher, final Shape shape) {
- return new CountingBloomFilter( hasher, shape );
+ return new CountingBloomFilter(hasher, shape);
}
@@ -153,13 +153,13 @@ public class CountingBloomFilterTest extends AbstractBloomFilterTest {
1, 2, 2, 2, 2, 2, 2, 2, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 0
};
- final List<Integer> lst = Arrays.asList( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ,16 ,17 );
- final Hasher hasher = new StaticHasher( lst.iterator(), shape );
+ final List<Integer> lst = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ,16 ,17);
+ final Hasher hasher = new StaticHasher(lst.iterator(), shape);
final CountingBloomFilter bf = createFilter(hasher, shape);
- final List<Integer> lst2 = Arrays.asList( 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 ,26 ,27 );
- final Hasher hasher2 = new StaticHasher( lst2.iterator(), shape );
+ final List<Integer> lst2 = Arrays.asList(11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 ,26 ,27);
+ final Hasher hasher2 = new StaticHasher(lst2.iterator(), shape);
final BloomFilter bf2 = createFilter(hasher2, shape);
bf.merge(bf2);
@@ -174,10 +174,10 @@ public class CountingBloomFilterTest extends AbstractBloomFilterTest {
{
if (m.get(i) == null)
{
- assertEquals( "Wrong value for "+i, expected[i], 0 );
+ assertEquals("Wrong value for "+i, expected[i], 0);
} else
{
- assertEquals( "Wrong value for "+i, expected[i], m.get(i).intValue());
+ assertEquals("Wrong value for "+i, expected[i], m.get(i).intValue());
}
}
}
@@ -192,13 +192,13 @@ public class CountingBloomFilterTest extends AbstractBloomFilterTest {
1, 2, 2, 2, 2, 2, 2, 2, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 0
};
- final List<Integer> lst = Arrays.asList( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ,16 ,17 );
- final Hasher hasher = new StaticHasher( lst.iterator(), shape );
+ final List<Integer> lst = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ,16 ,17);
+ final Hasher hasher = new StaticHasher(lst.iterator(), shape);
final CountingBloomFilter bf = createFilter(hasher, shape);
- final List<Integer> lst2 = Arrays.asList( 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 ,26 ,27 );
- final Hasher hasher2 = new StaticHasher( lst2.iterator(), shape );
+ final List<Integer> lst2 = Arrays.asList(11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 ,26 ,27);
+ final Hasher hasher2 = new StaticHasher(lst2.iterator(), shape);
final BloomFilter bf2 = new BitSetBloomFilter(hasher2, shape);
bf.merge(bf2);
@@ -213,10 +213,10 @@ public class CountingBloomFilterTest extends AbstractBloomFilterTest {
{
if (m.get(i) == null)
{
- assertEquals( "Wrong value for "+i, expected[i], 0 );
+ assertEquals("Wrong value for "+i, expected[i], 0);
} else
{
- assertEquals( "Wrong value for "+i, expected[i], m.get(i).intValue());
+ assertEquals("Wrong value for "+i, expected[i], m.get(i).intValue());
}
}
@@ -228,15 +228,15 @@ public class CountingBloomFilterTest extends AbstractBloomFilterTest {
@Test
public void mergeTest_Overflow() {
- final List<Integer> lst = Arrays.asList( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ,16 ,17 );
- final Hasher hasher = new StaticHasher( lst.iterator(), shape );
+ final List<Integer> lst = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ,16 ,17);
+ final Hasher hasher = new StaticHasher(lst.iterator(), shape);
CountingBloomFilter bf = createFilter(hasher, shape);
final Map<Integer,Integer> map = new HashMap<>();
- bf.getCounts().forEach( e -> map.put( e.getKey(), e.getValue()));
- map.put(1, Integer.MAX_VALUE );
+ bf.getCounts().forEach(e -> map.put(e.getKey(), e.getValue()));
+ map.put(1, Integer.MAX_VALUE);
CountingBloomFilter bf2 = new CountingBloomFilter(map, shape);
@@ -268,13 +268,13 @@ public class CountingBloomFilterTest extends AbstractBloomFilterTest {
1, 1, 1, 1, 1, 1, 1, 1, 0
};
- final List<Integer> lst = Arrays.asList( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ,16 ,17 );
- final Hasher hasher = new StaticHasher( lst.iterator(), shape );
+ final List<Integer> lst = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ,16 ,17);
+ final Hasher hasher = new StaticHasher(lst.iterator(), shape);
final CountingBloomFilter bf = createFilter(hasher, shape);
- final List<Integer> lst2 = Arrays.asList( 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 ,26 ,27 );
- final Hasher hasher2 = new StaticHasher( lst2.iterator(), shape );
+ final List<Integer> lst2 = Arrays.asList(11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 ,26 ,27);
+ final Hasher hasher2 = new StaticHasher(lst2.iterator(), shape);
bf.merge(hasher2);
@@ -288,10 +288,10 @@ public class CountingBloomFilterTest extends AbstractBloomFilterTest {
{
if (m.get(i) == null)
{
- assertEquals( "Wrong value for "+i, expected[i], 0 );
+ assertEquals("Wrong value for "+i, expected[i], 0);
} else
{
- assertEquals( "Wrong value for "+i, expected[i], m.get(i).intValue());
+ assertEquals("Wrong value for "+i, expected[i], m.get(i).intValue());
}
}
}
@@ -309,24 +309,24 @@ public class CountingBloomFilterTest extends AbstractBloomFilterTest {
final Map<Integer,Integer> map = new HashMap<>();
for (int i=1;i<values.length;i++)
{
- map.put( i, values[i] );
+ map.put(i, values[i]);
}
- final CountingBloomFilter bf = new CountingBloomFilter( map, shape );
+ final CountingBloomFilter bf = new CountingBloomFilter(map, shape);
- final List<Integer> lst = Arrays.asList( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ,16 ,17 );
- final Hasher hasher = new StaticHasher( lst.iterator(), shape );
- final BloomFilter bf2 = new CountingBloomFilter( hasher, shape );
+ final List<Integer> lst = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ,16 ,17);
+ final Hasher hasher = new StaticHasher(lst.iterator(), shape);
+ final BloomFilter bf2 = new CountingBloomFilter(hasher, shape);
- bf.remove( bf2 );
- assertEquals( 17, bf.cardinality() );
+ bf.remove(bf2);
+ assertEquals(17, bf.cardinality());
final Map<Integer,Integer> map2 = new HashMap<>();
- bf.getCounts().forEach( e -> map2.put( e.getKey(), e.getValue()));
+ bf.getCounts().forEach(e -> map2.put(e.getKey(), e.getValue()));
- for (int i = 11; i<values.length; i++ )
+ for (int i = 11; i<values.length; i++)
{
- assertNotNull( map2.get(i) );
- assertEquals( 1, map2.get(i).intValue());
+ assertNotNull(map2.get(i));
+ assertEquals(1, map2.get(i).intValue());
}
}
@@ -344,24 +344,24 @@ public class CountingBloomFilterTest extends AbstractBloomFilterTest {
final Map<Integer,Integer> map = new HashMap<>();
for (int i=1;i<values.length;i++)
{
- map.put( i, values[i] );
+ map.put(i, values[i]);
}
- final CountingBloomFilter bf = new CountingBloomFilter( map, shape );
+ final CountingBloomFilter bf = new CountingBloomFilter(map, shape);
- final List<Integer> lst = Arrays.asList( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ,16 ,17 );
- final Hasher hasher = new StaticHasher( lst.iterator(), shape );
+ final List<Integer> lst = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ,16 ,17);
+ final Hasher hasher = new StaticHasher(lst.iterator(), shape);
- bf.remove( hasher );
- assertEquals( 17, bf.cardinality() );
+ bf.remove(hasher);
+ assertEquals(17, bf.cardinality());
final Map<Integer,Integer> map2 = new HashMap<>();
- bf.getCounts().forEach( e -> map2.put( e.getKey(), e.getValue()));
+ bf.getCounts().forEach(e -> map2.put(e.getKey(), e.getValue()));
- for (int i = 11; i<values.length; i++ )
+ for (int i = 11; i<values.length; i++)
{
- assertNotNull( map2.get(i) );
- assertEquals( 1, map2.get(i).intValue());
+ assertNotNull(map2.get(i));
+ assertEquals(1, map2.get(i).intValue());
}
}
@@ -379,24 +379,24 @@ public class CountingBloomFilterTest extends AbstractBloomFilterTest {
final Map<Integer,Integer> map = new HashMap<>();
for (int i=1;i<values.length;i++)
{
- map.put( i, values[i] );
+ map.put(i, values[i]);
}
- final CountingBloomFilter bf = new CountingBloomFilter( map, shape );
+ final CountingBloomFilter bf = new CountingBloomFilter(map, shape);
- final List<Integer> lst = Arrays.asList( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ,16 ,17 );
- final Hasher hasher = new StaticHasher( lst.iterator(), shape );
- final BitSetBloomFilter bf2 = new BitSetBloomFilter( hasher, shape );
+ final List<Integer> lst = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ,16 ,17);
+ final Hasher hasher = new StaticHasher(lst.iterator(), shape);
+ final BitSetBloomFilter bf2 = new BitSetBloomFilter(hasher, shape);
- bf.remove( bf2 );
- assertEquals( 17, bf.cardinality() );
+ bf.remove(bf2);
+ assertEquals(17, bf.cardinality());
final Map<Integer,Integer> map2 = new HashMap<>();
- bf.getCounts().forEach( e -> map2.put( e.getKey(), e.getValue()));
+ bf.getCounts().forEach(e -> map2.put(e.getKey(), e.getValue()));
- for (int i = 11; i<values.length; i++ )
+ for (int i = 11; i<values.length; i++)
{
- assertNotNull( map2.get(i) );
- assertEquals( 1, map2.get(i).intValue());
+ assertNotNull(map2.get(i));
+ assertEquals(1, map2.get(i).intValue());
}
}
@@ -407,14 +407,14 @@ public class CountingBloomFilterTest extends AbstractBloomFilterTest {
@Test
public void removeTest_Underflow() {
- final List<Integer> lst = Arrays.asList( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ,16 ,17 );
- final Hasher hasher = new StaticHasher( lst.iterator(), shape );
+ final List<Integer> lst = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ,16 ,17);
+ final Hasher hasher = new StaticHasher(lst.iterator(), shape);
CountingBloomFilter bf = createFilter(hasher, shape);
final Map<Integer,Integer> map = new HashMap<>();
- bf.getCounts().forEach( e -> map.put( e.getKey(), e.getValue()));
+ bf.getCounts().forEach(e -> map.put(e.getKey(), e.getValue()));
map.remove(1);
CountingBloomFilter bf2 = new CountingBloomFilter(map, shape);
diff --git a/src/test/java/org/apache/commons/collections4/bloomfilter/SetOperationsTest.java b/src/test/java/org/apache/commons/collections4/bloomfilter/SetOperationsTest.java
index 27d04f4..a8fc4eb 100644
--- a/src/test/java/org/apache/commons/collections4/bloomfilter/SetOperationsTest.java
+++ b/src/test/java/org/apache/commons/collections4/bloomfilter/SetOperationsTest.java
@@ -109,7 +109,7 @@ public class SetOperationsTest {
// build a filter
final List<Integer> lst = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17);
final Hasher hasher = new StaticHasher(lst.iterator(), shape);
- final BloomFilter filter3 = new HasherBloomFilter( hasher, shape );
+ final BloomFilter filter3 = new HasherBloomFilter(hasher, shape);
assertEquals(1.0, SetOperations.cosineDistance(filter1, filter2), 0.0001);
assertEquals(1.0, SetOperations.cosineDistance(filter2, filter1), 0.0001);
@@ -154,7 +154,7 @@ public class SetOperationsTest {
// build a filter
final List<Integer> lst = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17);
final Hasher hasher = new StaticHasher(lst.iterator(), shape);
- final BloomFilter filter3 = new HasherBloomFilter( hasher, shape );
+ final BloomFilter filter3 = new HasherBloomFilter(hasher, shape);
assertEquals(0.0, SetOperations.cosineSimilarity(filter1, filter2), 0.0001);
assertEquals(0.0, SetOperations.cosineSimilarity(filter2, filter1), 0.0001);
@@ -293,7 +293,7 @@ public class SetOperationsTest {
// build a filter
final List<Integer> lst = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17);
final Hasher hasher = new StaticHasher(lst.iterator(), shape);
- final BloomFilter filter3 = new HasherBloomFilter( hasher, shape );
+ final BloomFilter filter3 = new HasherBloomFilter(hasher, shape);
assertEquals(1.0, SetOperations.jaccardDistance(filter1, filter2), 0.0001);
assertEquals(1.0, SetOperations.jaccardDistance(filter2, filter1), 0.0001);
@@ -337,7 +337,7 @@ public class SetOperationsTest {
// build a filter
final List<Integer> lst = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17);
final Hasher hasher = new StaticHasher(lst.iterator(), shape);
- final BloomFilter filter3 = new HasherBloomFilter( hasher, shape );
+ final BloomFilter filter3 = new HasherBloomFilter(hasher, shape);
assertEquals(0.0, SetOperations.jaccardSimilarity(filter1, filter2), 0.0001);
assertEquals(0.0, SetOperations.jaccardSimilarity(filter2, filter1), 0.0001);
diff --git a/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/StaticHasherTest.java b/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/StaticHasherTest.java
index cb3924d..f622171 100644
--- a/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/StaticHasherTest.java
+++ b/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/StaticHasherTest.java
@@ -329,10 +329,10 @@ public class StaticHasherTest {
StaticHasher hasher = new StaticHasher(lst.iterator(), shape);
- assertTrue( hasher.isEmpty() );
+ assertTrue(hasher.isEmpty());
- lst.add( Integer.valueOf( 1 ));
+ lst.add( Integer.valueOf(1));
hasher = new StaticHasher(lst.iterator(), shape);
- assertFalse( hasher.isEmpty() );
+ assertFalse(hasher.isEmpty());
}
}