### Question:
PostgresqlQueryRewriter extends LimitOffsetQueryRewriter { @Override public void setStatementParameter(PreparedStatement st, int valueIndex, Column column, Object value) throws SQLException { switch (column.getNativeType()) { case "json": case "jsonb": assert column.getType() == ColumnType.MAP; if (value == null) { st.setObject(valueIndex, null); } else { final PGobject pgo = new PGobject(); pgo.setType(column.getNativeType()); if (value instanceof Map) { try { pgo.setValue(jsonObjectMapper.writeValueAsString(value)); } catch (Exception e) { throw new IllegalArgumentException("Unable to write value as JSON string: " + value); } } else { pgo.setValue(value.toString()); } st.setObject(valueIndex, pgo); } return; } super.setStatementParameter(st, valueIndex, column, value); } PostgresqlQueryRewriter(JdbcDataContext dataContext); @Override ColumnType getColumnType(int jdbcType, String nativeType, Integer columnSize); @Override String rewriteColumnType(ColumnType columnType, Integer columnSize); @Override void setStatementParameter(PreparedStatement st, int valueIndex, Column column, Object value); @Override Object getResultSetValue(ResultSet resultSet, int columnIndex, Column column);  }### Answer:
@Test public void testInsertNullMap() throws SQLException { final PreparedStatement statementMock = EasyMock.createMock(PreparedStatement.class); final PostgresqlQueryRewriter queryRewriter = new PostgresqlQueryRewriter(null); final Column column = new MutableColumn("col").setType(ColumnType.MAP).setNativeType("jsonb"); final Object value = null; statementMock.setObject(0, null); EasyMock.replay(statementMock); queryRewriter.setStatementParameter(statementMock, 0, column, value); EasyMock.verify(statementMock); }