class ImmutablePolicy implements Policy {

    @Override
    public Policy removeResourceFor(final CharSequence label, final ResourceKey resourceKey) {
        final Label lbl = Label.of(label);

        Policy result = this;

        final PolicyEntry existingEntry = entries.get(lbl);
        if (null != existingEntry) {
            final Resources existingResources = existingEntry.getResources();
            final Resources newResources = existingResources.removeResource(resourceKey);
            if (!Objects.equals(existingResources, newResources)) {
                final Map<Label, PolicyEntry> entriesCopy = copyEntries();
                entriesCopy.put(lbl, newPolicyEntry(lbl, existingEntry.getSubjects(), newResources));
                result = new ImmutablePolicy(policyId, entriesCopy, lifecycle, revision, modified, created);
            }
        }

        return result;
    }

    private  ImmutablePolicy(@Nullable final PolicyId policyId,
            final Map<Label, PolicyEntry> theEntries,
            @Nullable final PolicyLifecycle lifecycle,
            @Nullable final PolicyRevision revision,
            @Nullable final Instant modified,
            @Nullable final Instant created);

}