class Polynomial {

  @Nonnull
  public BigInteger evaluateAt(@Nonnull final BigInteger x) {
    checkNotNull(x, "\'x\' must not be null");
    
    BigInteger cumulativeValueAtX = BigInteger.ZERO;
    
    for (final Integer exponent : coefficients.keySet()) {
      final BigInteger coefficient = coefficients.get(exponent);
      final BigInteger xToPower = x.pow(exponent);
      
      cumulativeValueAtX = cumulativeValueAtX.add(coefficient.multiply(xToPower));
    }
    
    return cumulativeValueAtX;
  }

  public  Polynomial(@Nonnull final Map<Integer, BigInteger> coefficients);

}