### Question:
Shamir { @Nonnull public Set<Share> createShares(@Nonnull final BigInteger secret, @Nonnull final CreationScheme creationScheme) { return rxShamir .createShares(secret, creationScheme) .collectInto(new HashSet<Share>(), Set::add) .blockingGet(); } Shamir(@Nonnull final SecureRandom random); @Nonnull static Shamir create(@Nonnull final SecureRandom random); @Nonnull Set<Share> createShares(@Nonnull final BigInteger secret, @Nonnull final CreationScheme creationScheme); @Nonnull BigInteger recoverSecret(@Nonnull final Set<Share> shares, @Nonnull final RecoveryScheme recoveryScheme);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void testCreateShares_nullSecret() { final CreationScheme creationScheme = CreationScheme .builder() .setRequiredShareCount(2) .setTotalShareCount(2) .setPrime(7) .build(); shamir.createShares(null, creationScheme); }
@Test(expected = IllegalArgumentException.class) public void testCreateShares_nullCreationScheme() { shamir.createShares(ONE, null); }
@Test public void testCreateShares_secretLessThanPrime() { final CreationScheme creationScheme = CreationScheme .builder() .setRequiredShareCount(2) .setTotalShareCount(3) .setPrime(7) .build(); shamir.createShares(FIVE, creationScheme); }
@Test(expected = IllegalStateException.class) public void testCreateShares_secretEqualToPrime() { final CreationScheme creationScheme = CreationScheme .builder() .setRequiredShareCount(2) .setTotalShareCount(3) .setPrime(5) .build(); shamir.createShares(FIVE, creationScheme); }
@Test(expected = IllegalStateException.class) public void testCreateShares_secretGreaterThanPrime() { final CreationScheme creationScheme = CreationScheme .builder() .setRequiredShareCount(2) .setTotalShareCount(3) .setPrime(5) .build(); shamir.createShares(SEVEN, creationScheme); }