// Path: src/main/java/moulder/Moulder.java
// public interface Moulder {
//     /**
//      * This is where a moulder can process the input element to generate its
//      * result.
//      *
//      * @param element the element and its associated data to process
//      * @return the list of nodes and their associated data that were generated
//      *         after processing the input element.
//      */
//     List<Node> process(Element element);
// }


import moulder.Moulder;
import org.jsoup.nodes.Element;
import org.jsoup.nodes.Node;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
package moulder.moulds.helpers;



public class MouldersApplier {
    public static Collection<Node> applyMoulder(Moulder moulder, Collection<Node> nodes) {
        List<Node> res = new ArrayList<Node>();
        for(Node node: nodes) {
            if(node instanceof Element) {
                res.addAll(moulder.process((Element) node));
            } else {
                res.add(node);
            }
        }
        return res;
    }
    public static Collection<Node> applyMoulders(Collection<Moulder> moulders, Collection<Node> nodes) {
        if(moulders.isEmpty()) {
            return nodes;
        } else {
            Collection<Node> workingSet = new ArrayList<Node>(nodes);
// Path: src/main/java/moulder/Moulder.java
// public interface Moulder {
//     /**
//      * This is where a moulder can process the input element to generate its
//      * result.
//      *
//      * @param element the element and its associated data to process
//      * @return the list of nodes and their associated data that were generated
//      *         after processing the input element.
//      */
//     List<Node> process(Element element);
// }


// Path: src/main/java/moulder/moulds/helpers/MouldersApplier.java
import moulder.Moulder;
import org.jsoup.nodes.Element;
import org.jsoup.nodes.Node;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

package moulder.moulds.helpers;



public class MouldersApplier {
    public static Collection<Node> applyMoulder(Moulder moulder, Collection<Node> nodes) {
        List<Node> res = new ArrayList<Node>();
        for(Node node: nodes) {
            if(node instanceof Element) {
                res.addAll(moulder.process((Element) node));
            } else {
                res.add(node);
            }
        }
        return res;
    }
    public static Collection<Node> applyMoulders(Collection<Moulder> moulders, Collection<Node> nodes) {
        if(moulders.isEmpty()) {
            return nodes;
        } else {
            Collection<Node> workingSet = new ArrayList<Node>(nodes);
            for(Moulder moulder: moulders) {