PolicyTag extends AbstractEntityIdWithRevision<PolicyId> { public static PolicyTag fromJson(final JsonObject jsonObject) { checkNotNull(jsonObject, "JSON object"); final PolicyId policyId = PolicyId.of(jsonObject.getValueOrThrow(JsonFields.ID)); final Long revision = jsonObject.getValueOrThrow(JsonFields.REVISION); return new PolicyTag(policyId, revision); } private  PolicyTag(final PolicyId policyId, final long revision); static PolicyTag of(final PolicyId policyId, final long revision); static PolicyTag fromJson(final JsonObject jsonObject);  }
@Test public void createInstanceFromValidJson() { final PolicyTag underTest = PolicyTag.fromJson(KNOWN_JSON); assertThat(underTest).isNotNull(); assertThat((CharSequence) underTest.getEntityId()).isEqualTo(TestConstants.Policy.POLICY_ID); assertThat(underTest.getRevision()).isEqualTo(TestConstants.Policy.REVISION_NUMBER); }