public static BigDecimal ensureFit(final BigDecimal value, final Schema schema) {
    return ensureFit(value, precision(schema), scale(schema));
  }
@Test
  public void shouldFailFitIfNotExactMatchMoreDigits() {
    // When:
    final Exception e = assertThrows(
        ArithmeticException.class,
        () -> ensureFit(new BigDecimal("12"), DECIMAL_SCHEMA)
    );

    // Then:
    assertThat(e.getMessage(), containsString("Numeric field overflow: A field with precision 2 and "
        + "scale 1 must round to an absolute value less than 10^1. Got 12"));
  }