ImmutablePolicyBuilder implements PolicyBuilder { @Override @Deprecated public ImmutablePolicyBuilder setId(final CharSequence id) { return setId(PolicyId.of(id)); } private  ImmutablePolicyBuilder(); static ImmutablePolicyBuilder newInstance(); static ImmutablePolicyBuilder of(final PolicyId id); static PolicyBuilder of(final PolicyId id, final Iterable<PolicyEntry> policyEntries); static PolicyBuilder of(final Policy existingPolicy); @Override LabelScoped forLabel(final Label label); @Override @Deprecated ImmutablePolicyBuilder setId(final CharSequence id); @Override ImmutablePolicyBuilder setId(final PolicyId id); @Override ImmutablePolicyBuilder setLifecycle(@Nullable final PolicyLifecycle lifecycle); @Override ImmutablePolicyBuilder setRevision(@Nullable final PolicyRevision revision); @Override ImmutablePolicyBuilder setModified(@Nullable final Instant modified); @Override ImmutablePolicyBuilder setCreated(@Nullable final Instant created); @Override ImmutablePolicyBuilder set(final PolicyEntry entry); @Override ImmutablePolicyBuilder setAll(final Iterable<PolicyEntry> entries); @Override ImmutablePolicyBuilder remove(final CharSequence label); @Override ImmutablePolicyBuilder removeAll(final Iterable<PolicyEntry> entries); @Override ImmutablePolicyBuilder setSubjectsFor(final CharSequence label, final Subjects subjects); @Override ImmutablePolicyBuilder setSubjectFor(final CharSequence label, final Subject subject); @Override ImmutablePolicyBuilder removeSubjectFor(final CharSequence label,
            final CharSequence subjectIssuerWithId); @Override ImmutablePolicyBuilder removeSubjectFor(final CharSequence label, final Subject subject); @Override ImmutablePolicyBuilder setResourcesFor(final CharSequence label, final Resources resources); @Override ImmutablePolicyBuilder setResourceFor(final CharSequence label, final Resource resource); @Override ImmutablePolicyBuilder removeResourceFor(final CharSequence label, final ResourceKey resourceKey); @Override ImmutablePolicyBuilder removeResourceFor(final CharSequence label, final Resource resource); @Override ImmutablePolicyBuilder setPermissionsFor(final CharSequence label, final ResourceKey resourceKey,
            final EffectedPermissions effectedPermissions); @Override ImmutablePolicyBuilder setGrantedPermissionsFor(final CharSequence label, final ResourceKey resourceKey,
            final Permissions grantedPermissions); @Override ImmutablePolicyBuilder setRevokedPermissionsFor(final CharSequence label, final ResourceKey resourceKey,
            final Permissions revokedPermissions); @Override Policy build();  }
@Test public void tryToSetNullPolicyId() { assertThatExceptionOfType(NullPointerException.class) .isThrownBy(() -> underTest.setId(null)) .withMessage("The Policy ID must not be null!") .withNoCause(); }
@Test public void tryToSetNullPolicyIdCharSequence() { assertThatExceptionOfType(PolicyIdInvalidException.class) .isThrownBy(() -> underTest.setId((CharSequence) null)) .withMessage("Policy ID 'null' is not valid!"); }