static String createSingleFileCommentContent( final ChangedFile changedFile, final Violation violation, final String commentTemplate) { final MustacheFactory mf = new DefaultMustacheFactory(); Reader templateReader = null; final Optional<String> commentTemplateOpt = ofNullable(commentTemplate); if (commentTemplateOpt.isPresent() && !commentTemplateOpt.get().isEmpty()) { templateReader = new StringReader(commentTemplateOpt.get()); } else { templateReader = mf.getReader(DEFAULT_VIOLATION_TEMPLATE_MUSTACH); } final Mustache mustache = mf.compile(templateReader, "Violation Template"); final Writer writer = new StringWriter(); final Map<String, Object> context = new HashMap<>(); context.put("violation", new ViolationData(violation)); context.put("changedFile", changedFile); final List<Object> scopes = new ArrayList<>(); scopes.add(context); mustache.execute(writer, scopes); return writer.toString() + "\n\n*" + FINGERPRINT + "* *<" + identifier(violation) + ">*"; }