StringTemplateUtil { public static StringTemplateGroup loadTemplateGroupAngleBracket(String templateName) { try (InputStreamReader reader = getTemplateInputStreamReader(templateName)) { return new StringTemplateGroup(reader); } catch(IOException e) { LOGGER.error("Error reading resource {}", templateName, e); } throw new IllegalArgumentException("Resource not found: " + templateName); } private  StringTemplateUtil(); static StringTemplateGroup loadTemplateGroupAngleBracket(String templateName); static StringTemplateGroup loadTemplateGroupDollarSign(String templateName);  }
@Test public void testLoadTemplateGroup() { StringTemplateGroup stringTemplateGroup = StringTemplateUtil.loadTemplateGroupAngleBracket("/stg/Test.stg"); assertStringTemplate(stringTemplateGroup); }
@Test(expected = IllegalArgumentException.class) public void testLoadTemplateGroupNotExisting() { StringTemplateUtil.loadTemplateGroupAngleBracket("/not/existing/file.stg"); }