public static BigDecimal convertToDecimal(Schema schema, Object value, int scale) {
        if (value == null) {
            throw new DataException("Unable to convert a null value to a schema that requires a value");
        }
        return convertToDecimal(Decimal.schema(scale), value);
    }
@Test
    public void shouldConvertDecimalValues() {
        // Various forms of the same number should all be parsed to the same BigDecimal
        Number number = 1.0f;
        String string = number.toString();
        BigDecimal value = new BigDecimal(string);
        byte[] bytes = Decimal.fromLogical(Decimal.schema(1), value);
        ByteBuffer buffer = ByteBuffer.wrap(bytes);

        assertEquals(value, Values.convertToDecimal(null, number, 1));
        assertEquals(value, Values.convertToDecimal(null, string, 1));
        assertEquals(value, Values.convertToDecimal(null, value, 1));
        assertEquals(value, Values.convertToDecimal(null, bytes, 1));
        assertEquals(value, Values.convertToDecimal(null, buffer, 1));
    }