### Question:
FactTypeHelper { public void assertFactTypeNotExists(String name) throws InvalidArgumentException { if (factManager.getFactType(name) != null) { throw new InvalidArgumentException() .addValidationError(String.format("FactType with name = %s already exists.", name), "fact.type.exist", "name", name); } } @Inject  FactTypeHelper(FactManager factManager, ObjectManager objectManager); void assertFactTypeNotExists(String name); void assertObjectTypesToBindExist(List<FactObjectBindingDefinition> bindingDefinitions, String propertyName); void assertFactTypesToBindExist(List<MetaFactBindingDefinition> bindingDefinitions, String propertyName); Set<FactTypeEntity.FactObjectBindingDefinition> convertFactObjectBindingDefinitions(List<FactObjectBindingDefinition> bindingDefinitions); Set<FactTypeEntity.MetaFactBindingDefinition> convertMetaFactBindingDefinitions(List<MetaFactBindingDefinition> bindingDefinitions);  }### Answer:
@Test public void testAssertFactTypeNotExistsSuccess() throws Exception { helper.assertFactTypeNotExists("type"); verify(factManager).getFactType("type"); }
@Test(expected = InvalidArgumentException.class) public void testAssertFactTypeNotExistsFailure() throws Exception { when(factManager.getFactType(anyString())).thenReturn(new FactTypeEntity()); helper.assertFactTypeNotExists("type"); }