### Question:
CSVGenerator { public static String imaRecordsToCsv(final ImaAcceptableRecordBaseline imaBaseline) { LOGGER.info("Retrieved and parsing all records"); StringBuilder sb = new StringBuilder(); for (IMABaselineRecord record : imaBaseline.getBaselineRecords()) { String stringHashValue; Digest theHash = record.getHash(); if (theHash == null) { stringHashValue = ""; } else { final byte[] digest = theHash.getDigest(); final char[] hash = Hex.encodeHex(digest); stringHashValue = String.valueOf(hash); } sb.append("\"") .append(record.getPath().replace("\"", "\"\"")) .append("\",") .append(stringHashValue) .append(System.lineSeparator()); } return sb.toString(); } private  CSVGenerator(); static String imaRecordsToCsv(final ImaAcceptableRecordBaseline imaBaseline); static String ignoreSetToCsv(final ImaIgnoreSetBaseline ignoreSetBaseline); static String blacklistToCsv(final ImaBlacklistBaseline blacklistBaseline); static String tpmRecordsToCsv(final TPMBaseline tpmBaseline); static String nullToEmpty(final String str);  }### Answer:
@Test public void testEncodeImaBaseline() { System.out.println(CSVGenerator.imaRecordsToCsv(imaBaseline)); Assert.assertEquals(CSV, CSVGenerator.imaRecordsToCsv(imaBaseline)); }