test_class.declarator: thrown = ExpectedException.none()
test_class.modifier: @Rule
  	public final
test_class.original_string: @Rule
  	public final ExpectedException thrown = ExpectedException.none();
test_class.type: ExpectedException
test_class.var_name: thrown
test_class.declarator: persistenceService = mock(CategoriesPersistenceService.class)
test_class.modifier: private final
test_class.original_string: private final CategoriesPersistenceService persistenceService = mock(CategoriesPersistenceService.class);
test_class.type: CategoriesPersistenceService
test_class.var_name: persistenceService
test_class.declarator: categoriesService = new CategoriesService(persistenceService,
  			new EntityEventSupport())
test_class.modifier: private final
test_class.original_string: private final CategoriesService categoriesService = new CategoriesService(persistenceService,
  			new EntityEventSupport());
test_class.type: CategoriesService
test_class.var_name: categoriesService
test_class.declarator: categories = new Categories(ImmutableList.of(new Category("A")))
test_class.modifier: private final
test_class.original_string: private final Categories categories = new Categories(ImmutableList.of(new Category("A")));
test_class.type: Categories
test_class.var_name: categories
test_class.declarator: savedCategories
test_class.modifier: private
test_class.original_string: private Categories savedCategories;
test_class.type: Categories
test_class.var_name: savedCategories
test_class.file: services/src/test/java/com/greensopinion/finance/services/domain/CategoriesServiceTest.java
test_class.identifier: CategoriesServiceTest
test_case.body: @Test
  	public void createDuplicateName() {
  		thrown.expect(ValidationException.class);
  		thrown.expectMessage(
  				"Category with name \"a\" cannot be created since a category with the same name already exists.");
  		categoriesService.create(new Category("a "));
  	}
test_case.class_method_signature: CategoriesServiceTest.createDuplicateName()
test_case.full_signature: @Test public void createDuplicateName()
test_case.identifier: createDuplicateName
test_case.invocations: expect expectMessage create
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void createDuplicateName()
focal_class.file: services/src/main/java/com/greensopinion/finance/services/domain/CategoriesService.java
focal_class.identifier: CategoriesService
focal_class.class_method_signature: CategoriesService.CategoriesService(CategoriesPersistenceService persistenceService, EntityEventSupport eventSupport)
focal_class.full_signature: @Inject  CategoriesService(CategoriesPersistenceService persistenceService, EntityEventSupport eventSupport)
focal_class.identifier: CategoriesService
focal_class.modifiers: @Inject
focal_class.parameters: (CategoriesPersistenceService persistenceService, EntityEventSupport eventSupport)
focal_class.signature:  CategoriesService(CategoriesPersistenceService persistenceService, EntityEventSupport eventSupport)
focal_class.class_method_signature: CategoriesService.create(Category category)
focal_class.full_signature: public void create(Category category)
focal_class.identifier: create
focal_class.modifiers: public
focal_class.parameters: (Category category)
focal_class.return: void
focal_class.signature: void create(Category category)
focal_class.class_method_signature: CategoriesService.deleteByName(String name)
focal_class.full_signature: public void deleteByName(String name)
focal_class.identifier: deleteByName
focal_class.modifiers: public
focal_class.parameters: (String name)
focal_class.return: void
focal_class.signature: void deleteByName(String name)
focal_class.class_method_signature: CategoriesService.addRuleByName(String name, MatchRule matchRule)
focal_class.full_signature: public void addRuleByName(String name, MatchRule matchRule)
focal_class.identifier: addRuleByName
focal_class.modifiers: public
focal_class.parameters: (String name, MatchRule matchRule)
focal_class.return: void
focal_class.signature: void addRuleByName(String name, MatchRule matchRule)
focal_class.class_method_signature: CategoriesService.findCategoryByName(Categories categories, String name)
focal_class.full_signature: private Category findCategoryByName(Categories categories, String name)
focal_class.identifier: findCategoryByName
focal_class.modifiers: private
focal_class.parameters: (Categories categories, String name)
focal_class.return: Category
focal_class.signature: Category findCategoryByName(Categories categories, String name)
focal_class.superclass: extends ConfigurationService<Categories>
focal_method.body: public void create(Category category) {
  		validateNotNull(category, "Must provide a category.");
  		validateRequired(category.getName(), "Category name");
  
  		String name = category.getName().trim();
  		Categories categories = retrieve();
  		validate(categories.getCategoryByName(name) == null,
  				format("Category with name \"{0}\" cannot be created since a category with the same name already exists.",
  						name));
  
  		Categories newCategories = new Categories(
  				ImmutableList.<Category> builder().addAll(categories.getCategories()).add(new Category(name)).build());
  		update(newCategories);
  	}
focal_method.class_method_signature: CategoriesService.create(Category category)
focal_method.full_signature: public void create(Category category)
focal_method.identifier: create
focal_method.invocations: validateNotNull validateRequired getName trim getName retrieve validate getCategoryByName format build add addAll builder getCategories update
focal_method.modifiers: public
focal_method.parameters: (Category category)
focal_method.return: void
focal_method.signature: void create(Category category)