ConnectionTag extends AbstractEntityIdWithRevision<ConnectionId> { public static ConnectionTag fromJson(final JsonObject jsonObject) { checkNotNull(jsonObject, "JSON object"); final ConnectionId connectionId = ConnectionId.of(jsonObject.getValueOrThrow(JsonFields.ID)); final Long revision = jsonObject.getValueOrThrow(JsonFields.REVISION); return new ConnectionTag(connectionId, revision); } private  ConnectionTag(final ConnectionId id, final long revision); static ConnectionTag of(final ConnectionId id, final long revision); static ConnectionTag fromJson(final JsonObject jsonObject);  }
@Test public void createInstanceFromValidJson() { final ConnectionTag underTest = ConnectionTag.fromJson(KNOWN_JSON); Assertions.assertThat(underTest).isNotNull(); Assertions.assertThat((CharSequence) underTest.getEntityId()).isEqualTo(CONNECTION_ID); Assertions.assertThat(underTest.getRevision()).isEqualTo(REVISION); }