@Override
	public ResourceSet update(ResourceSet oldRs, ResourceSet newRs) {

		if (oldRs.getId() == null || newRs.getId() == null
				|| !oldRs.getId().equals(newRs.getId())) {

			throw new IllegalArgumentException("Resource set IDs mismatched");

		}

		if (!checkScopeConsistency(newRs)) {
			throw new IllegalArgumentException("Can't save a resource set with inconsistent claims.");
		}

		newRs.setOwner(oldRs.getOwner()); // preserve the owner tag across updates
		newRs.setClientId(oldRs.getClientId()); // preserve the client id across updates

		ResourceSet saved = repository.save(newRs);

		return saved;

	}
@Test(expected = IllegalArgumentException.class)
	public void testUpdate_nullId2() {
		ResourceSet rs = new ResourceSet();

		ResourceSet rs2 = new ResourceSet();
		rs2.setId(1L);

		resourceSetService.update(rs, rs2);
	}