// Finds all the objects
int initialNumber = catalogService.findAllCategories().size();
// Creates an object
Category category = new Category("Fish", "Any of numerous cold-blooded aquatic vertebrates characteristically having fins, gills, and a streamlined body");
// Persists the object
category = catalogService.createCategory(category);
Long id = category.getId();
// Finds all the objects and checks there's an extra one
assertEquals("Should have an extra object", initialNumber + 1, catalogService.findAllCategories().size());
// Finds the object by primary key
category = catalogService.findCategory(id);
assertEquals("Fish", category.getName());
// Updates the object
category.setName("Big Fish");
catalogService.updateCategory(category);
// Finds the object by primary key
category = catalogService.findCategory(id);
assertEquals("Big Fish", category.getName());
// Deletes the object
catalogService.removeCategory(category);
// Checks the object has been deleted