// Finds all the objects
int initialNumber = catalogService.findAllProducts().size();
// Creates an object
Category category = new Category("Fish", "Any of numerous cold-blooded aquatic vertebrates characteristically having fins, gills, and a streamlined body");
Product product = new Product("Angelfish", "Saltwater fish from Australia", category);
// Persists the object
product = catalogService.createProduct(product);
Long id = product.getId();
// Finds all the objects and checks there's an extra one
assertEquals("Should have an extra object", initialNumber + 1, catalogService.findAllProducts().size());
// Finds the object by primary key
product = catalogService.findProduct(id);
assertEquals("Angelfish", product.getName());
// Updates the object
product.setName("Big Angelfish");
catalogService.updateProduct(product);
// Finds the object by primary key
product = catalogService.findProduct(id);
assertEquals("Big Angelfish", product.getName());
// Deletes the object
catalogService.removeProduct(product);
// Checks the object has been deleted