code:     public ScimGroup delete(String id, int version) throws ScimResourceNotFoundException {
          ScimGroup group = retrieve(id);
          membershipManager.removeMembersByGroupId(id);
          externalGroupMappingManager.unmapAll(id);
          int deleted;
          if (version > 0) {
              deleted = jdbcTemplate.update(DELETE_GROUP_SQL + " and version=?;", id, IdentityZoneHolder.get().getId(),version);
          } else {
              deleted = jdbcTemplate.update(DELETE_GROUP_SQL, id, IdentityZoneHolder.get().getId());
          }
          if (deleted != 1) {
              throw new IncorrectResultSizeDataAccessException(1, deleted);
          }
          return group;
      }
  
  