STGroup group = new STGroupFile(tmpdir + "/t.stg");
// try to get an undefined template.
// This will add an entry to the "templates" field in STGroup, however
// this should not be returned.
group.lookupTemplate("t2");
Set<String> names = group.getTemplateNames();
// Should only contain "t" and "main" (not "t2")
assertEquals(2, names.size());