void appendMatchedClause(StringBuilder sb) {
        sb.append("WHEN MATCHED THEN ");
        sb.append("UPDATE ");
        sb.append("SET");
        Iterator<String> it = jdbcTable.dbFieldNames().iterator();
        while (it.hasNext()) {
            String dbFieldName = it.next();
            sb.append(' ');
            dialect.quoteIdentifier(sb, dbFieldName);
            sb.append(" = source.");
            dialect.quoteIdentifier(sb, dbFieldName);
            if (it.hasNext()) {
                sb.append(',');
            }
        }
        sb.append(" WHEN NOT MATCHED THEN INSERT ");
        appendFieldNames(sb, jdbcTable.dbFieldNames());
        sb.append(" VALUES");
        appendSourceFieldNames(sb, jdbcTable.dbFieldNames());
        sb.append(";");
    }
@Test
    void appendMatchedClause() {
        MSSQLUpsertQueryBuilder builder = new MSSQLUpsertQueryBuilder(jdbcTable, dialect);
        StringBuilder sb = new StringBuilder();
        builder.appendMatchedClause(sb);

        String matchedClause = sb.toString();
        assertThat(matchedClause).isEqualTo(
                "WHEN MATCHED THEN UPDATE SET [field1] = source.[field1], [field2] = source.[field2] "
                        + "WHEN NOT MATCHED THEN INSERT ([field1], [field2]) VALUES(source.[field1], source.[field2]);");
    }