// Path: src/main/java/moulder/Registry.java
// public static final class TemplatorConfig {
//     public final String selector;
//     public final List<Moulder> templators;
// 
//     public TemplatorConfig(String selector, List<Moulder> templators) {
//         this.selector = selector;
//         this.templators = templators;
//     }
// }
// 
// Path: src/main/java/moulder/moulds/helpers/MouldersApplier.java
// 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) {
//                 workingSet = applyMoulder(moulder, workingSet);
//             }
//             return workingSet;
//         }
//     }
// }


import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import moulder.Registry.TemplatorConfig;
import moulder.moulds.helpers.MouldersApplier;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.nodes.Node;
import org.jsoup.select.Elements;
package moulder;




public class MoulderShop {

    private final Registry registry = new Registry();

    public MoulderChain select(String selector) {
        List<Moulder> moulders = new ArrayList<Moulder>();
        registry.register(selector, moulders);
        return new MoulderChain(moulders);
    }

    public MoulderShop register(String selector, Moulder... moulders) {
        return register(selector, Arrays.asList(moulders));
    }

    public MoulderShop register(String selector, List<Moulder> templators) {
        registry.register(selector, templators);
// Path: src/main/java/moulder/Registry.java
// public static final class TemplatorConfig {
//     public final String selector;
//     public final List<Moulder> templators;
// 
//     public TemplatorConfig(String selector, List<Moulder> templators) {
//         this.selector = selector;
//         this.templators = templators;
//     }
// }
// 
// Path: src/main/java/moulder/moulds/helpers/MouldersApplier.java
// 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) {
//                 workingSet = applyMoulder(moulder, workingSet);
//             }
//             return workingSet;
//         }
//     }
// }


// Path: src/main/java/moulder/MoulderShop.java
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import moulder.Registry.TemplatorConfig;
import moulder.moulds.helpers.MouldersApplier;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.nodes.Node;
import org.jsoup.select.Elements;

package moulder;




public class MoulderShop {

    private final Registry registry = new Registry();

    public MoulderChain select(String selector) {
        List<Moulder> moulders = new ArrayList<Moulder>();
        registry.register(selector, moulders);
        return new MoulderChain(moulders);
    }

    public MoulderShop register(String selector, Moulder... moulders) {
        return register(selector, Arrays.asList(moulders));
    }

    public MoulderShop register(String selector, List<Moulder> templators) {
        registry.register(selector, templators);
        return this;