@Test void fromSupplierShouldNotThrowWhenUpperBoundExclusiveIsGenerated() { assertThatCode(() -> UidValidity.fromSupplier(() -> 4294967296L)) .doesNotThrowAnyException(); }
@VisibleForTesting static UidValidity fromSupplier(Supplier<Long> longSupplier) { long randomValue = Math.abs(longSupplier.get()); long sanitizedRandomValue = 1 + (randomValue % (UPPER_EXCLUSIVE_BOUND - 1)); return of(sanitizedRandomValue); }
UidValidity { @VisibleForTesting static UidValidity fromSupplier(Supplier<Long> longSupplier) { long randomValue = Math.abs(longSupplier.get()); long sanitizedRandomValue = 1 + (randomValue % (UPPER_EXCLUSIVE_BOUND - 1)); return of(sanitizedRandomValue); } }
UidValidity { @VisibleForTesting static UidValidity fromSupplier(Supplier<Long> longSupplier) { long randomValue = Math.abs(longSupplier.get()); long sanitizedRandomValue = 1 + (randomValue % (UPPER_EXCLUSIVE_BOUND - 1)); return of(sanitizedRandomValue); } private  UidValidity(long uidValidity); }
UidValidity { @VisibleForTesting static UidValidity fromSupplier(Supplier<Long> longSupplier) { long randomValue = Math.abs(longSupplier.get()); long sanitizedRandomValue = 1 + (randomValue % (UPPER_EXCLUSIVE_BOUND - 1)); return of(sanitizedRandomValue); } private  UidValidity(long uidValidity); static UidValidity generate(); static UidValidity of(long uidValidity); static boolean isValid(long uidValidityAsLong); boolean isValid(); long asLong(); @Override final boolean equals(Object obj); @Override final int hashCode(); @Override String toString(); }
UidValidity { @VisibleForTesting static UidValidity fromSupplier(Supplier<Long> longSupplier) { long randomValue = Math.abs(longSupplier.get()); long sanitizedRandomValue = 1 + (randomValue % (UPPER_EXCLUSIVE_BOUND - 1)); return of(sanitizedRandomValue); } private  UidValidity(long uidValidity); static UidValidity generate(); static UidValidity of(long uidValidity); static boolean isValid(long uidValidityAsLong); boolean isValid(); long asLong(); @Override final boolean equals(Object obj); @Override final int hashCode(); @Override String toString();  }