private ReportModel getReportModel(ITestResult testResult, Class<?> clazz) {
        ConcurrentHashMap<String, ReportModel> reportModels = getReportModels(testResult.getTestContext());

        ReportModel model = reportModels.get(clazz.getName());
        if (model == null) {
            model = new ReportModel();
            model.setTestClass(clazz);
            ReportModel previousModel = reportModels.putIfAbsent(clazz.getName(), model);
            if (previousModel != null) {
                model = previousModel;
            }
        }
        AssertionUtil.assertNotNull(model, "Report model is null");
        return model;
    }
TestNG Test listener to enable JGiven for a test class.
jgiven-testng/src/main/java/com/tngtech/jgiven/testng/ScenarioTestListener.java