Bael 1010 hll (#2256)

* BAEL-1010 HLL article code

* BAEL-1010 moved tolerated difference to a variable

* Merge branch 'master' of https://github.com/eugenp/tutorials into BAEL-1010_hll

# Conflicts:
#	libraries/pom.xml

* BAEL-1010 clearer code
This commit is contained in:
Tomasz Lelek 2017-07-13 20:24:49 +02:00 committed by KevinGilmore
parent 7df3f24350
commit 3718dfd0d1
1 changed files with 11 additions and 10 deletions

View File

@ -57,7 +57,8 @@ public class HLLUnitTest {
//then
firstHll.union(secondHLL);
long cardinality = firstHll.cardinality();
assertThat(isSimilarTo(cardinality, numberOfElements * 2, toleratedDifference)).isTrue();
assertThat(isSimilarTo(cardinality, numberOfElements * 2,
toleratedDifference * 2)).isTrue();
}
private boolean isSimilarTo(long cardinality, int numberOfElements, int maxToleratedDifference) {