class MoshasEngine {

    public Template describe(String templateName, ViewLogicDescriber describer) {
        if (describer == null) {
            throw new IllegalArgumentException("describer is required");
        }

        Template template = manager.loadTemplate(templateName);

        describeSnippet(template, describer);
        // Mark selected elements
        Element root = template.getRootElement();
        root.children().forEach(Element::selected);

        manager.cacheTemplate(templateName, template);
        describerCache.put(templateName, describer);
        return template;
    }

}

class MoshasEngineTest {

    @Parameterized.Parameter(0)
    public MoshasEngine engine;

    @Test(expected = TemplateNotFoundException.class)
    public void test() {

        engine.describe("notfound", t -> {});
    }

}