}
System.out.println();
System.out.println("Search for iPhone in the Product database");
request = new ClientRequest(shoppingLinks.get("products").getHref() + "?name=iPhone");
Products products = request.getTarget(Products.class);
Product product = null;
if (products.getProducts().size() > 0)
{
System.out.println("- Found iPhone in the database.");
product = products.getProducts().iterator().next();
}
else
{
throw new RuntimeException("Failed to find an iPhone in the database!");
}