### Question:
ProcessCategoryDatastore extends CommonDatastore<ProcessCategoryItem, Serializable> implements
        DatastoreHasAdd<ProcessCategoryItem>,
        DatastoreHasDelete { @Override public ProcessCategoryItem add(final ProcessCategoryItem item) { try { getProcessAPI().addCategoriesToProcess(item.getProcessId().toLong(), Arrays.asList(item.getCategoryId().toLong())); return item; } catch (AlreadyExistsException e) { throw new APIForbiddenException(new _("This category has already been added to this process"), e); } catch (final Exception e) { throw new APIException(e); } } ProcessCategoryDatastore(final APISession engineSession); @Override void delete(final List<APIID> ids); @Override ProcessCategoryItem add(final ProcessCategoryItem item);  }### Answer:
@Test(expected = APIForbiddenException.class) public void addingTwiceSameCategoryOnProcessIsForbidden() throws Exception { ProcessCategoryItem processCategory = aProcessCategory().build(); doThrow(new AlreadyExistsException("this thing already exists!")).when(processAPI) .addCategoriesToProcess(processCategory.getProcessId().toLong(), asList(processCategory.getCategoryId().toLong())); processCategoryDatastore.add(processCategory); }