String dir = getRandomDir();
String a =
"a(x) ::= <<foo>>\n" +
"b() ::= <<bar>>\n";
writeFile(dir, "a.stg", a);
STGroup group = new STGroupFile(dir+"/a.stg");
group.load(); // force load
ST st = group.getInstanceOf("a");
int originalHashCode = System.identityHashCode(st);
group.unload(); // blast cache
st = group.getInstanceOf("a");
int newHashCode = System.identityHashCode(st);
assertEquals(originalHashCode==newHashCode, false); // diff objects
String expected = "foo";
String result = st.render();
assertEquals(expected, result);
st = group.getInstanceOf("b");
expected = "bar";
result = st.render();
assertEquals(expected, result);
}