@JsonCreator
    public static BatchSizeConfig parse(String value) {
        try {
            return new BatchSizeConfig(value, Size.parse(value), null);
        } catch (IllegalArgumentException sizeParsingException) {
            try {
                return new BatchSizeConfig(value, null, Integer.valueOf(value));
            } catch (NumberFormatException ignored) {
                throw new IllegalArgumentException(f("\"%s\" is neither a size [%s] nor an integer.", value,
                        sizeParsingException.getLocalizedMessage()));
            }
        }
    }
@Test
    void validateSize() throws ValidationException {
        final var validator = new BatchSizeConfig.Validator();
        validator.validate("setting", BatchSizeConfig.parse("500 kb"));
        assertThatThrownBy(() ->
                validator.validate("setting", BatchSizeConfig.parse("500 mb")))
                .isInstanceOf(ValidationException.class);
    }