Update core-java-modules/core-java-uuid/src/test/java/com/baeldung/uuid/UUIDPositiveLongGeneratorUnitTest.java

assert that the value is positive

Co-authored-by: Liam Williams <liam.williams@zoho.com>
This commit is contained in:
Hangga Aji Sayekti 2023-11-02 09:39:43 +07:00 committed by GitHub
parent b946f580f4
commit 9fe75192ec
1 changed files with 1 additions and 0 deletions

View File

@ -43,6 +43,7 @@ public class UUIDPositiveLongGeneratorUnitTest {
int collisions = 0; int collisions = 0;
for (int i = 0; i < n; i++) { for (int i = 0; i < n; i++) {
long uniqueValue = (long) method.invoke(uuidLongGenerator); long uniqueValue = (long) method.invoke(uuidLongGenerator);
assertThat(uniqueValue).isPositive();
if (!uniqueValues.add(uniqueValue)) { if (!uniqueValues.add(uniqueValue)) {
collisions++; collisions++;
} }