private static List<Invoice> generateDemoInvoice() throws Exception {
List<Invoice> result = new ArrayList<Invoice>();
// create a simple demo invoice (use most of the default values)
Invoice demo = InvoiceFactory.getInstance().getInvoice();
// used for identifying this invoice in the response (optional)
demo.setClientId("myUniqueId");
// set the recipient of the invoice
demo.setRecipient(generateDemoRecipient());
// add an invoice line
demo.addInvoiceLine(new BigDecimal("1.00"), "Fakturalinje #1", new BigDecimal("100.00"));
// send the invoice by email with a copy to my accountant
Shipment shipment = ShipmentFactory.getInstance(ShipmentType.email);
shipment.addEmailAddress("kari@nordmann.no");
shipment.addCopyAddress("kopi@regnskap.no");
demo.setShipment(shipment);
// add the demo invoice to the list to return. You can add as many
// invoices you like, the only limit is the file size of the generated
// xml that can't exceed 2Mb
result.add(demo);