Set MathContext to BinaryOperator reference methods
问题 I have this enum: public enum Operator { add("+", BigDecimal::add), subtract("-", BigDecimal::subtract), multiply("*", BigDecimal::multiply), divide("/", BigDecimal::divide), mod("%", BigDecimal::remainder); Operator(final String symbol, final BinaryOperator<BigDecimal> operation) { this.symbol = symbol; this.operation = operation; } public BinaryOperator<BigDecimal> getOperation() { return operation; } } I want to use the some MathContext , one can easily do that when performing an operation