class Badger {

    private static final PebbleEngine ENGINE = new PebbleEngine.Builder().newLineTrimming(false).build();
    private static final PebbleTemplate PROJECT_VULNS_TEMPLATE = ENGINE.getTemplate("templates/badge/project-vulns.peb");
    private static final PebbleTemplate PROJECT_VULNS_NONE_TEMPLATE = ENGINE.getTemplate("templates/badge/project-vulns-none.peb");
    private static final PebbleTemplate PROJECT_VULNS_NO_METRICS_TEMPLATE = ENGINE.getTemplate("templates/badge/project-vulns-nometrics.peb");
    private static final PebbleTemplate PROJECT_VIOLATIONS_TEMPLATE = ENGINE.getTemplate("templates/badge/project-violations.peb");
    private static final PebbleTemplate PROJECT_VIOLATIONS_NONE_TEMPLATE = ENGINE.getTemplate("templates/badge/project-violations-none.peb");
    private static final PebbleTemplate PROJECT_VIOLATIONS_NO_METRICS_TEMPLATE = ENGINE.getTemplate("templates/badge/project-violations-nometrics.peb");

    public String generateVulnerabilities(ProjectMetrics metrics) {
        final Map<String, Object> context = new HashMap<>();
        context.put("roundedPixels", "3");
        if (metrics == null) {
            return writeSvg(PROJECT_VULNS_NO_METRICS_TEMPLATE, context);
        } else if (metrics.getVulnerabilities() > 0) {
            context.put("critical", String.valueOf(metrics.getCritical()));
            context.put("high", String.valueOf(metrics.getHigh()));
            context.put("medium", String.valueOf(metrics.getMedium()));
            context.put("low", String.valueOf(metrics.getLow()));
            context.put("unassigned", String.valueOf(metrics.getUnassigned()));
            return writeSvg(PROJECT_VULNS_TEMPLATE, context);
        } else {
            return writeSvg(PROJECT_VULNS_NONE_TEMPLATE, context);
        }
    }

    public String generateViolations(ProjectMetrics metrics) {<FILL_FUNCTION_BODY>}

    private String writeSvg(PebbleTemplate template, Map<String, Object> context) {
        try (Writer writer = new StringWriter()) {
            template.evaluate(writer, context);
            return writer.toString();
        } catch (IOException e) {
            Logger.getLogger(this.getClass()).error("An error was encountered evaluating template", e);
            return null;
        }
    }
}

        final Map<String, Object> context = new HashMap<>();
        context.put("roundedPixels", "3");
        if (metrics == null) {
            return writeSvg(PROJECT_VIOLATIONS_NO_METRICS_TEMPLATE, context);
        } else if (metrics.getPolicyViolationsTotal() > 0) {
            context.put("fail", String.valueOf(metrics.getPolicyViolationsFail()));
            context.put("warn", String.valueOf(metrics.getPolicyViolationsWarn()));
            context.put("info", String.valueOf(metrics.getPolicyViolationsInfo()));
            return writeSvg(PROJECT_VIOLATIONS_TEMPLATE, context);
        } else {
            return writeSvg(PROJECT_VIOLATIONS_NONE_TEMPLATE, context);
        }
    
<no_super_class>