@Test
public void appendChangedParametersList()
  throws BeanException, ReportDataFactoryException, ParserConfigurationException, XPathExpressionException,
  CloneNotSupportedException {

  final LinkedHashMap<String, ParameterDefinitionEntry> parameterDefinitions = getParametersMap();
  final DefaultParameterContext context = getTestParameterContext();
  final ValidationResult vr = new ValidationResult();
  vr.setParameterValues( new ReportParameterValues() );
  handler.document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
  final ParameterDependencyGraph dependencies =
    new ParameterDependencyGraph( "first", "second", "third", "fourth", "fifth", "sixth" );
  dependencies.addDependency( "first", "second" );
  dependencies.addDependency( "first", "fourth" );
  dependencies.addDependency( "second", "third" );
  dependencies.addDependency( "third", "seventh" );
  dependencies.addDependency( "second", "fourth" );
  //How about some cycles?
  dependencies.addDependency( "fourth", "third" );
  dependencies.addDependency( "third", "fourth" );
  //Independent parameters
  dependencies.addDependency( "fifth", "sixth" );
  // [PRD-6038] For certain queries, test against having a dependency of itself, ensure it does not lose changed status
  dependencies.addDependency( "first", "first" );
  final Element parameters = handler.document.createElement( "parameters" );
  handler.document.appendChild( parameters );
  handler.appendParametersList( context, vr, parameters, dependencies, parameterDefinitions,
    new HashMap<>(), new HashSet<>( Collections.singletonList( "first" ) ) );
  System.out.println( toString( handler.document ) );
  examineChangedDependentParameters( handler.document );
}