System.out.println("** Buy an iPhone for Bill Burke");
System.out.println();
System.out.println("** First see if Bill Burke exists as a customer");
request = new ClientRequest(shoppingLinks.get("customers").getHref() + "?firstName=Bill&lastName=Burke");
Customers customers = request.getTarget(Customers.class);
Customer customer = null;
if (customers.getCustomers().size() > 0)
{
System.out.println("- Found a Bill Burke in the database, using that");
customer = customers.getCustomers().iterator().next();
}
else
{
System.out.println("- Cound not find a Bill Burke in the database, creating one.");
customer = new Customer();