### Question:
RemoveAttributeGroup { public RemoveAttributeGroupEngineResponseDto process() throws ApplicationException { if (request.getNamespace() == null) { throw new ApplicationException("no namepspace specified"); } if (request.getOrganismId() == 0) { throw new ApplicationException("no organism id specified, but don't know how to list all organisms. yet."); } if (request.getAttributeGroupId() > 0) { throw new ApplicationException("can not remove core attribute group"); } AttributeGroups groups = cache.getAttributeGroups(request.getNamespace(), request.getOrganismId()); if (groups.getAttributeGroups().containsKey(request.getAttributeGroupId())) { groups.getAttributeGroups().remove(request.getAttributeGroupId()); cache.putAttributeGroups(groups); cache.removeData(new AttributeData(request.getNamespace(), request.getOrganismId(), request.getAttributeGroupId())); } return new RemoveAttributeGroupEngineResponseDto(); } RemoveAttributeGroup(DataCache cache,
            RemoveAttributeGroupEngineRequestDto request); RemoveAttributeGroupEngineResponseDto process();  }### Answer:
@Test public void test() throws Exception { String namespace = "user1"; long attributeGroupId = -1; createUserAttributeGroup(namespace, config.getOrg1Id(), attributeGroupId, 10); AttributeGroups groups = cacheBuilder.getCache().getAttributeGroups(namespace, config.getOrg1Id()); assertEquals(config.getNumAttributeGroups() + 1, groups.getAttributeGroups().size()); assertTrue(groups.getAttributeGroups().containsKey(attributeGroupId)); AttributeData attributeData = cacheBuilder.getCache().getAttributeData(namespace, config.getOrg1Id(), attributeGroupId); assertNotNull(attributeData); RemoveAttributeGroupEngineRequestDto request = new RemoveAttributeGroupEngineRequestDto(); request.setNamespace(namespace); request.setOrganismId(config.getOrg1Id()); request.setAttributeGroupId(attributeGroupId); RemoveAttributeGroup removeAttributeGroupAction = new RemoveAttributeGroup(cacheBuilder.getCache(), request); RemoveAttributeGroupEngineResponseDto result = removeAttributeGroupAction.process(); assertNotNull(result); groups = cacheBuilder.getCache().getAttributeGroups(namespace, config.getOrg1Id()); assertEquals(config.getNumAttributeGroups(), groups.getAttributeGroups().size()); assertFalse(groups.getAttributeGroups().containsKey(attributeGroupId)); try { attributeData = cacheBuilder.getCache().getAttributeData(namespace, config.getOrg1Id(), attributeGroupId); fail("should not find attribute data!"); } catch (ApplicationException e) { } }