### Question:
QRCodeGenerator { public File generate() { QRCode qrCode = new QRCode(); File file = qrCode.encode(profile); return file; } private  QRCodeGenerator(); static void main(String[] args); static QRCodeGenerator newGenerator(); QRCodeGenerator content(String content); QRCodeGenerator width(int width); QRCodeGenerator height(int height); QRCodeGenerator path(String path); QRCodeGenerator logoPath(String logoPath); QRCodeGenerator format(String format); QRCodeGenerator errorCorrectionLevel(ErrorCorrectionLevel errorCorrectionLevel); QRCodeGenerator characterSet(String characterSet); QRCodeGenerator margin(int margin); QRCodeGenerator logoFlag(boolean logoFlag); File generate(); OutputStream generateOutputStream();  }### Answer:
@Test public void testGenerate() throws Exception { String logoPath = getClass().getClassLoader().getResource("logo.jpg").getFile(); String folder = new File(logoPath).getParent(); File png = QRCodeGenerator.newGenerator() .content("http: .characterSet("UTF-8") .errorCorrectionLevel(ErrorCorrectionLevel.H) .logoFlag(true) .format("png") .margin(0) .width(300) .height(300) .path(folder) .logoPath(logoPath) .generate(); Assert.assertTrue(png.exists()); File png2 = QRCodeGenerator.newGenerator() .content("http: .generate(); System.out.println(png); System.out.println(png2); Assert.assertTrue(png2.exists()); QRCode qrCode = new QRCode(); String decode = qrCode.decode(png.getPath()); Assert.assertEquals(decode, "http: }