private String buildWhereClause() {
		StringBuilder builder = new StringBuilder();
		if (!linkClauses.isEmpty()) {
			builder.append(" AND (");
			boolean printAnd = false;
			for (String link : linkClauses) {
				if (printAnd) {
					builder.append(" AND ");
				}
				builder.append(link);
				printAnd = true;
			}
			builder.append(')');
		}

		for (Entry<BSimFilterType, List<String>> entry : wherelist.entrySet()) {
			// Start with an AND clause because there are other clauses in the SQL string that may
			// have been added before this - even if there aren't, having this here will not cause
			// a problem.
			builder.append(" AND ");

			BSimFilterType filter = entry.getKey();
			String finalClause = filter.buildSQLCombinedClause(entry.getValue());
			builder.append(finalClause);
		}

		return builder.toString();
	}
Given our sorted container of string pieces, combine them into a single SQL where clause,
connecting them appropriately with 'AND' and 'OR' keywords and parentheses.
@return the final where String
Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/client/SQLEffects.java