### Question:
ResourceSetLabelRegistration { void updateLabelsForDeletedResourceSet(ResourceSetDescription resourceSet) { JsonValue labels = resourceSet.getDescription().get(OAuth2Constants.ResourceSets.LABELS); if (!labels.isNull() && labels.size() > 0) { updateLabels(resourceSet, Collections.<String>emptySet(), labels.asSet(String.class)); } } @Inject  ResourceSetLabelRegistration(UmaLabelsStore labelsStore);   }### Answer:
@Test public void shouldUpdateLabelsForDeletedResourceSet() throws Exception { ResourceSetDescription resourceSet = newResourceSet("LABEL_ONE", "LABEL_TWO"); givenLabelsExist("LABEL_ONE", "LABEL_TWO"); givenLabelsAreNotIsUse("LABEL_ONE"); labelRegistration.updateLabelsForDeletedResourceSet(resourceSet); ArgumentCaptor<ResourceSetLabel> labelCaptor = ArgumentCaptor.forClass(ResourceSetLabel.class); verify(labelsStore, times(2)).update(eq("REALM"), eq("RESOURCE_OWNER_ID"), labelCaptor.capture()); ArgumentCaptor<String> deletedLabelsCaptor = ArgumentCaptor.forClass(String.class); verify(labelsStore, times(2)).delete(eq("REALM"), eq("RESOURCE_OWNER_ID"), deletedLabelsCaptor.capture()); List<ResourceSetLabel> labels = labelCaptor.getAllValues(); for (ResourceSetLabel label : labels) { assertThat(label.getResourceSetIds()).isEmpty(); } deletedLabelsCaptor.getAllValues().containsAll(Arrays.asList("CLIENT_ID/LABEL_ONE", "CLIENT_ID/LABEL_TWO")); }