code: public static BigInteger[] generateRandomCoefficients(int n, BigInteger elementZero, BigInteger prime) {
          BigInteger[] res = new BigInteger[n];
          res[0] = elementZero;
          for (int i = 1; i < n; i++) {
              res[i] = SasUtils.generateRandomIntegerLessThan(prime);
          }
          return res;
      }
docs: Generate random coefficients for the Shamir's Secret Sharing algorithm. First coefficient is filled with a known
  value and the rest of the coefficients are randomly generated, keeping them less than the specified prime.
  
  @param n number of coefficients to generate
  @param elementZero value of the first coefficient
  @param prime upper bound for randomly generated coefficients
  @return array of generated coefficients