@Test
public void testGetInitialDataQuality() {

    // result object store
    ProcessInitialDataQuality.InitialDataQuality test;
    // try with null data set
    test = ProcessInitialDataQuality.getInitialDataQuality(null);
    assertThat("Result object not null", test != null, is(true));
    assertThat("Null input should fail", test.pass, is(false));
    // try with empty data set
    List<BgReading> bgReadingList = new ArrayList<>();
    test = ProcessInitialDataQuality.getInitialDataQuality(bgReadingList);
    assertThat("Result object not null", test != null, is(true));
    assertThat("Empty input should fail", test.pass, is(false));
    // create an assortment of data sets with data spaced out by different frequencies
    for (int frequency = 5; frequency < 21; frequency = frequency + 1) {
        bgReadingList.clear();
        for (int i = 1; i <= 3; i++) {
            // add an element
            bgReadingList.add(getGoodMockBgReading(i * Constants.MINUTE_IN_MS * frequency)); // we add older readings to the end
            test = ProcessInitialDataQuality.getInitialDataQuality(bgReadingList);
            log("Frequency: " + frequency + " Loop " + i + " size:" + bgReadingList.size()
                    + " Newest age: " + JoH.niceTimeScalar(JoH.msSince(bgReadingList.get(0).timestamp))
                    + " Oldest age: " + JoH.niceTimeScalar(JoH.msSince(bgReadingList.get(bgReadingList.size() - 1).timestamp))
                    + " / Mock Advice: " + test.advice + " VERDICT: " + (test.pass ? "PASS" : "NOT PASSED"));
            assertThat("Result object not null", test != null, is(true));
            if (i < 3) assertThat("Empty input should fail", test.pass, is(false));
            assertThat("There should be some advice on loop " + i, test.advice.length() > 0, is(true));
            final long ms_since = (JoH.msSince(bgReadingList.get(bgReadingList.size() - 1).timestamp));
            if ((ms_since > Constants.STALE_CALIBRATION_CUT_OFF + COMPUTATION_GRACE_TIME) || (i < 3)) {
                assertThat("Stale data should fail: i:" + i + " tm:" + ms_since, test.pass, is(false));
            }
            if ((ms_since <= Constants.STALE_CALIBRATION_CUT_OFF) && (bgReadingList.size() >= 3)) {
                assertThat("Good data should pass", test.pass, is(true));
            }
        }
    }
}