Skip to content

Commit

Permalink
Extra assertion on RandomSamplingTest.feedReturnValue
Browse files Browse the repository at this point in the history
  • Loading branch information
gstamatelat committed Jul 1, 2018
1 parent f434101 commit 5f803f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/test/java/gr/james/sampling/RandomSamplingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public void sampleOnDifferentTime() {

/**
* If {@link RandomSampling#feed(Object)} returned {@code true}, than the sample has definitely changed, assuming
* unique stream elements.
* unique stream elements. Furthermore, the new sample has to contain the new element.
*/
@Test
public void feedReturnValue() {
Expand All @@ -190,6 +190,7 @@ public void feedReturnValue() {
for (int i = 0; i < 65536; i++) {
final boolean changed = rs.feed(i);
Assert.assertEquals(changed, !RandomSamplingUtils.samplesEquals(sample, rs.sample()));
Assert.assertEquals(changed, rs.sample().contains(i));
sample = new ArrayList<>(rs.sample());
}
}
Expand Down

0 comments on commit 5f803f7

Please sign in to comment.