/***
 * Excerpted from "Domain-Driven Design Using Naked Objects",
 * published by The Pragmatic Bookshelf.
 * Copyrights apply to this code. It may not be used to create training material, 
 * courses, books, articles, and the like. Contact us if you are in doubt.
 * We make no guarantees that this code is fit for any purpose. 
 * Visit http://www.pragmaticprogrammer.com/titles/dhnako for more book information.
***/
protected Person createCustomer(
        final String titleName, 
        final String lastName, final String firstName) {
    Person customer = customerRepository.newCustomer();
    customer.getName().modifyTitle(findTitle(titleName));
    customer.getName().modifyLastName(lastName);
    customer.getName().modifyFirstName(firstName);
    
    @SuppressWarnings("unused")
    Customer customerRole = customer.getRole(Customer.class);
    // setup customer role if required.
    
    persist(customer);
    return customer;
}
