}
@Test
public void testConversionViceVersa() throws IOException, URISyntaxException {
final SerDeOption options = SerDeOption.PRETTY_PRINTING;
final DataStore store = TestDataStoreFactory.produce();
Serialization serialization = JsonConverter.serialize(store.getData(), options);
assertThat(serialization.getWarnings()).isEmpty();
final String json = serialization.getJson();
final Data parsedData = JsonConverter.deserialize(json).getData();
// can not be equals, because the IDs are different
assertThat(store.getData().equals(parsedData)).isFalse();
// must be equals, because the IDs are identical after conversion
Serialization serialization2 = JsonConverter.serialize(store.getData(), options);
assertThat(serialization2.getWarnings()).isEmpty();
final String expectedJson = serialization2.getJson();
final Data expectedData = JsonConverter.deserialize(expectedJson).getData();
assertThat(json).isEqualTo(expectedJson);
assertThat(parsedData).isEqualTo(expectedData);
// print some JSON
LOG.info(json);
// print some stats
LOG.info(store.getData().toStats());
LOG.info(parsedData.toStats());
// print size comparison
final String uasDataAsXml = UrlUtil.read(TestDataStoreFactory.DATA_URL, DataStore.DEFAULT_CHARSET);
LOG.info("size XML: " + humanReadableByteCount(uasDataAsXml.getBytes().length, false));
LOG.info("size JSON: " + humanReadableByteCount(JsonConverter.serialize(store.getData()).getJson().getBytes().length, false));
}