public void setCustomer(@PathParam("index") int index, Customer customer) {
CustomersResource.customers.set(index, customer);
}
private static Customer createCustomer(String name, String street, String town, PhoneNumber... phoneNumbers) {
Customer result = new Customer();
result.setName(name);
result.setAddress(new Address(street, town));
result.getPhoneNumbers().addAll(Arrays.asList(phoneNumbers));
return result;
}