### Question:
QRBill { public static byte[] generate(Bill bill) { try (Canvas canvas = createCanvas(bill.getFormat())) { validateAndGenerate(bill, canvas); return ((ByteArrayResult)canvas).toByteArray(); } catch (IOException e) { throw new QRBillGenerationException(e); } } private  QRBill(); static ValidationResult validate(Bill bill); static byte[] generate(Bill bill); static void draw(Bill bill, Canvas canvas); static void drawSeparators(SeparatorType separatorType, boolean withHorizontalLine, Canvas canvas); static String encodeQrCodeText(Bill bill); static Bill decodeQrCodeText(String text); static String getLibraryVersion(); static final double A4_PORTRAIT_WIDTH; static final double A4_PORTRAIT_HEIGHT; static final double QR_BILL_WIDTH; static final double QR_BILL_HEIGHT; static final double QR_BILL_WITH_HORI_LINE_WIDTH; static final double QR_BILL_WITH_HORI_LINE_HEIGHT; static final double QR_CODE_WIDTH; static final double QR_CODE_HEIGHT; }### Answer:
@Test void createQRBill4() { Bill bill = SampleData.getExample4(); bill.getFormat().setOutputSize(OutputSize.QR_BILL_ONLY); bill.getFormat().setGraphicsFormat(GraphicsFormat.SVG); byte[] svg = QRBill.generate(bill); FileComparison.assertFileContentsEqual(svg, "qrbill_ex4.svg"); }
@Test void createQRBill5() { Bill bill = SampleData.getExample3(); bill.getFormat().setOutputSize(OutputSize.QR_BILL_WITH_HORIZONTAL_LINE); bill.getFormat().setGraphicsFormat(GraphicsFormat.SVG); byte[] svg = QRBill.generate(bill); FileComparison.assertFileContentsEqual(svg, "qrbill_ex5.svg"); }
@Test void createQRBillFrench() { Bill bill = SampleData.getExample1(); bill.getFormat().setGraphicsFormat(GraphicsFormat.SVG); bill.getFormat().setLanguage(Language.FR); byte[] svg = QRBill.generate(bill); FileComparison.assertFileContentsEqual(svg, "qrbill_fr.svg"); }
@Test void createQRBill1() { Bill bill = SampleData.getExample1(); bill.getFormat().setOutputSize(OutputSize.QR_BILL_ONLY); bill.getFormat().setGraphicsFormat(GraphicsFormat.SVG); byte[] svg = QRBill.generate(bill); FileComparison.assertFileContentsEqual(svg, "qrbill_ex1.svg"); }
@Test void createQRBill2() { Bill bill = SampleData.getExample2(); bill.getFormat().setOutputSize(OutputSize.QR_BILL_ONLY); bill.getFormat().setGraphicsFormat(GraphicsFormat.SVG); byte[] svg = QRBill.generate(bill); FileComparison.assertFileContentsEqual(svg, "qrbill_ex2.svg"); }
@Test void createQRBill3() { Bill bill = SampleData.getExample3(); bill.getFormat().setOutputSize(OutputSize.QR_BILL_ONLY); bill.getFormat().setGraphicsFormat(GraphicsFormat.SVG); byte[] svg = QRBill.generate(bill); FileComparison.assertFileContentsEqual(svg, "qrbill_ex3.svg"); }