public static String getTroubleshootMessage(List<DiagnosisReport> diagnosisReports) {
        if (diagnosisReports == null || diagnosisReports.isEmpty()) {
            return null;
        }
        StringBuilder message = new StringBuilder();

        diagnosisReports.stream().forEach(each -> {
            if (each == null) {
                return;
            }
            String reason = each.getReason();
            if (StringUtils.isNotBlank(reason)) {
                message.append(reason);
                message.append(ToolConstants.DOT);
                message.append(ToolConstants.SPACE);
            }
            message.append(each.getRecommendedFix());
            message.append(ToolConstants.NEW_LINE);
        });
        return message.toString().trim();
    }
Helper class to provide troubleshoot related utilities
workflow-controller/controller-service/src/main/java/io/hyscale/controller/util/TroubleshootUtil.java