@@ -0,0 +1,1095 @@
+package ru.revdaalex.regex;%0A%0Aimport org.junit.Assert;%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Test;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0Aimport static org.hamcrest.core.Is.is;%0Aimport static org.junit.Assert.*;%0A%0A/**%0A * Created by revdaalex on 31.05.2016.%0A */%0Apublic class TemplateTest %7B%0A    private static Template template;%0A    private String text = %22I am a $%7Bname%7D, Who are $%7Bsubject%7D?%22;%0A    private static Map map = new HashMap();%0A    static %7B%0A        map.put(%22name%22, %22Petr%22);%0A        map.put(%22subject%22, %22you%22);%0A        map.put(%22test%22, %22test%22);%0A    %7D%0A%0A    @BeforeClass%0A    public static void run()%7B%0A        template = new SimpleGenerator();%0A    %7D%0A    @Test%0A    public void testGenerate()%7B%0A        String result = template.generate(text, map);%0A        String checked = %22I am a Petr, Who are you?%22;%0A%0A        Assert.assertThat(result, is(checked));%0A    %7D%0A%0A    @Test%0A    public void noKeyCheck()%7B%0A        if (map.size() == 0)Assert.fail(%22%D0%9E%D1%82%D1%81%D1%83%D1%82%D1%81%D1%82%D0%B2%D1%83%D1%8E%D1%82 %D0%B7%D0%BD%D0%B0%D1%87%D0%B5%D0%BD%D0%B8%D1%8F%22);%0A    %7D%0A%0A    @Test%0A    public void toManyKeyCheck()%7B%0A        if (map.size() %3E 2)Assert.fail(%22%D0%9B%D0%B8%D1%88%D0%BD%D0%B8%D0%B5 %D0%B7%D0%BD%D0%B0%D1%87%D0%B5%D0%BD%D0%B8%D1%8F%22);%0A    %7D%0A%7D

add TemplateTest.java