@Override
    public void rewrite(final ParameterBuilder paramBuilder, final SQLStatementContext sqlStatementContext, final List<Object> params) {
        InsertStatementContext insertStatementContext = (InsertStatementContext) sqlStatementContext;
        if (!insertStatementContext.getGeneratedKeyContext().isPresent()) {
            return;
        }
        ((GroupedParameterBuilder) paramBuilder).setDerivedColumnName(insertStatementContext.getGeneratedKeyContext().get().getColumnName());
        Iterator<Comparable<?>> generatedValues = insertStatementContext.getGeneratedKeyContext().get().getGeneratedValues().iterator();
        int count = 0;
        int parameterCount = 0;
        for (List<Object> each : insertStatementContext.getGroupedParameters()) {
            parameterCount += insertStatementContext.getInsertValueContexts().get(count).getParameterCount();
            Comparable<?> generatedValue = generatedValues.next();
            if (!each.isEmpty()) {
                ((GroupedParameterBuilder) paramBuilder).getParameterBuilders().get(count).addAddedParameters(parameterCount, new ArrayList<>(Collections.singleton(generatedValue)));
            }
            count++;
        }
    }
@Test
    void assertRewrite() {
        InsertStatementContext insertStatementContext = getInsertStatementContext();
        ParameterBuilder groupedParamBuilder = getParameterBuilder();
        GeneratedKeyInsertValueParameterRewriter paramRewriter = new GeneratedKeyInsertValueParameterRewriter();
        paramRewriter.rewrite(groupedParamBuilder, insertStatementContext, null);
        assertThat(((GroupedParameterBuilder) groupedParamBuilder).getParameterBuilders().get(0).getAddedIndexAndParameters().get(TEST_PARAMETER_COUNT), hasItem(TEST_GENERATED_VALUE));
    }