@Test
public void testHistoricState() {

    HistoricItem historicItem = PersistenceExtensions.historicState(item,
            ZonedDateTime.of(2012, 1, 1, 0, 0, 0, 0, ZoneId.systemDefault()), TestPersistenceService.ID);
    assertNotNull(historicItem);
    assertEquals("2012", historicItem.getState().toString());
    historicItem = PersistenceExtensions.historicState(item,
            ZonedDateTime.of(2011, 12, 31, 0, 0, 0, 0, ZoneId.systemDefault()), TestPersistenceService.ID);
    assertNotNull(historicItem);
    assertEquals("2011", historicItem.getState().toString());
    historicItem = PersistenceExtensions.historicState(item,
            ZonedDateTime.of(2011, 1, 1, 0, 0, 0, 0, ZoneId.systemDefault()), TestPersistenceService.ID);
    assertNotNull(historicItem);
    assertEquals("2011", historicItem.getState().toString());
    historicItem = PersistenceExtensions.historicState(item,
            ZonedDateTime.of(2000, 1, 1, 0, 0, 0, 0, ZoneId.systemDefault()), TestPersistenceService.ID);
    assertNotNull(historicItem);
    assertEquals("2000", historicItem.getState().toString());
    // default persistence service
    historicItem = PersistenceExtensions.historicState(item,
            ZonedDateTime.of(2000, 1, 1, 0, 0, 0, 0, ZoneId.systemDefault()));
    assertNull(historicItem);
}