public void removeUnusedVariables() {
    final Set<String> variables = getUsedVariableNames();
    variableConstraints.keySet().removeIf(key -> !variables.contains(key));
  }
public void removeUnusedVariables()