Skip to content

Conversation

@kail-is
Copy link
Contributor

@kail-is kail-is commented Sep 7, 2025

Summary

Add BigIntegerCombinableArbitrary wrapping Jqwik and Kotest BigInteger arbitraries with mathematical constraint enhancements following existing CombinableArbitrary pattern.

Description

Implemented BigIntegerCombinableArbitrary by wrapping existing BigInteger arbitrary implementations from Jqwik and Kotest frameworks, adding mathematical constraints and following established CombinableArbitrary patterns.

Added components:

  • BigIntegerCombinableArbitrary interface with mathematical constraint methods
  • BigIntegerCombinableArbitraryDelegator for filter/null injection operations
  • JqwikBigIntegerCombinableArbitrary wrapping Arbitraries.bigIntegers()
  • KotestBigIntegerCombinableArbitrary wrapping Arb.bigInt() (fixed from incorrect Byte implementation)
  • Factory method CombinableArbitrary.bigIntegers() with ServiceLoader integration

Key features:

  • Standard numeric constraints: .positive(), .negative(), .nonZero(), .withRange(BigInteger, BigInteger)
  • Mathematical properties: .even(), .odd(), .multipleOf(BigInteger), .prime()
  • Specialized ranges: .percentage() (0-100), .score(min, max)
  • Last-method-wins behavior for constraint precedence (mathematical constraints override previous ones)
  • Full integration with existing filter/map/unique operations

Usage example:

BigInteger nonZeroBigInt = CombinableArbitrary.bigIntegers().nonZero().combined();
BigInteger multipleOfTen = CombinableArbitrary.bigIntegers().multipleOf(BigInteger.TEN).combined();
BigInteger primeNumber = CombinableArbitrary.bigIntegers().withRange(BigInteger.valueOf(2), BigInteger.valueOf(100)).prime().combined();

How Has This Been Tested?

Added comprehensive test suite in BigIntegerCombinableArbitraryTest:

  • Basic constraint validation (positive, negative, even, odd, nonZero, multipleOf, prime)
  • Range constraint testing with various BigInteger boundaries
  • Method chaining and last-method-wins precedence verification
  • Integration with filter/map/unique operations
  • Complex mathematical constraint combinations and prime number generation
  • ServiceLoader integration testing for both Jqwik and Kotest implementations

Is the Document updated?

Documentation will be updated to include BigIntegerCombinableArbitrary usage examples alongside existing numeric arbitrary types, with special emphasis on mathematical property constraints and framework-specific implementations.

@kail-is
Copy link
Contributor Author

kail-is commented Dec 20, 2025

Closing in favor of #1261

  • combined all numeric CombinableArbitrary types (Float, Double, BigInteger, BigDecimal) into a single PR for cleaner review.

@kail-is kail-is closed this Dec 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant