@Test
  public void testDataJsonConsumption() throws Exception {
    JsonArray ginzburg = createJson("ginzburg", 1, 10);
    assertEquals(ginzburg.size(), 1);

    BasicSampleExtractor extractor = new BasicSampleExtractor();
    JsonObject jsonObject = ginzburg.getJsonObject(0);

    Optional<SampleData> sampleData = extractor.extractSample(jsonObject);
    assertTrue(sampleData.isPresent());
    assertEquals(sampleData.get().getPublishId(), "ginzburg");
    assertFalse(sampleData.get().getTime().isEmpty());

    double[] readings = extractor.extractReadings(jsonObject.getString(READINGS));
    assertEquals(readings.length, 10);

    DescriptiveStatistics stats = new DescriptiveStatistics(readings);
    double median = stats.getPercentile(50);
    assertEquals(sampleData.get().getMedian(), median);
  }
 @Test
 public void testDataReadingsExtractor() throws Exception {
   BasicSampleExtractor extractor = new BasicSampleExtractor();
   double[] readings = extractor.extractReadings(SAMPLE_READINGS);
   assertEquals(readings.length, 8);
 }