@Test
public void shouldSearchRecordsBasedOnTimestamp() throws Exception {

    // find records older than 1 day
    assertEquals(8, journal.recordsNewerThan(timestamp1.toLocalDateTime().minusDays(1), true, false).size());
    // find records older than ts1, inclusive
    assertEquals(5, journal.recordsNewerThan(timestamp1.toLocalDateTime(), true, false).size());
    // find records older than ts1, exclusive
    assertEquals(4, journal.recordsNewerThan(timestamp1.toLocalDateTime(), false, false).size());
    // find records older than ts2, exclusive
    assertEquals(2, journal.recordsNewerThan(timestamp2.toLocalDateTime(), false, false).size());
    // find records older than ts3, exclusive
    assertEquals(0, journal.recordsNewerThan(timestamp3.toLocalDateTime(), false, false).size());
    // find records older than ts3, inclusive
    assertEquals(1, journal.recordsNewerThan(timestamp3.toLocalDateTime(), true, false).size());
    // find records older than max, exclusive
    assertEquals(0, journal.recordsNewerThan(timestamp3.toLocalDateTime().plusDays(1), true, false).size());
}