### Question:
SubjectDeleted extends AbstractPolicyEvent<SubjectDeleted> implements PolicyEvent<SubjectDeleted> { @Deprecated public static SubjectDeleted of(final String policyId, final Label label, final SubjectId subjectId, final long revision, final DittoHeaders dittoHeaders) { return of(PolicyId.of(policyId), label, subjectId, revision, dittoHeaders); } private  SubjectDeleted(final PolicyId policyId,
            final Label label,
            final SubjectId subjectId,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders); @Deprecated static SubjectDeleted of(final String policyId,
            final Label label,
            final SubjectId subjectId,
            final long revision,
            final DittoHeaders dittoHeaders); static SubjectDeleted of(final PolicyId policyId,
            final Label label,
            final SubjectId subjectId,
            final long revision,
            final DittoHeaders dittoHeaders); @Deprecated static SubjectDeleted of(final String policyId,
            final Label label,
            final SubjectId subjectId,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders); static SubjectDeleted of(final PolicyId policyId,
            final Label label,
            final SubjectId subjectId,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders); static SubjectDeleted fromJson(final String jsonString, final DittoHeaders dittoHeaders); static SubjectDeleted fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); Label getLabel(); SubjectId getSubjectId(); @Override JsonPointer getResourcePath(); @Override SubjectDeleted setRevision(final long revision); @Override SubjectDeleted setDittoHeaders(final DittoHeaders dittoHeaders); @SuppressWarnings("squid:S109") @Override int hashCode(); @SuppressWarnings("squid:MethodCyclomaticComplexity") @Override boolean equals(@Nullable final Object o); @Override String toString(); static final String NAME; static final String TYPE; }### Answer:
@Test(expected = PolicyIdInvalidException.class) public void tryToCreateInstanceWithNullPolicyIdString() { SubjectDeleted.of((String) null, TestConstants.Policy.LABEL, TestConstants.Policy.SUBJECT_ID, TestConstants.Policy.REVISION_NUMBER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullPolicyId() { SubjectDeleted.of((PolicyId) null, TestConstants.Policy.LABEL, TestConstants.Policy.SUBJECT_ID, TestConstants.Policy.REVISION_NUMBER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullLabel() { SubjectDeleted.of(TestConstants.Policy.POLICY_ID, null, TestConstants.Policy.SUBJECT_ID, TestConstants.Policy.REVISION_NUMBER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullSubject() { SubjectDeleted.of(TestConstants.Policy.POLICY_ID, TestConstants.Policy.LABEL, null, TestConstants.Policy.REVISION_NUMBER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void toJsonReturnsExpected() { final SubjectDeleted underTest = SubjectDeleted.of(TestConstants.Policy.POLICY_ID, TestConstants.Policy.LABEL, TestConstants.Policy.SUBJECT_ID, TestConstants.Policy.REVISION_NUMBER, TestConstants.TIMESTAMP, TestConstants.EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }