@Test
public void testMaximumSince() {

    item.setState(new QuantityType<>(1, SIUnits.CELSIUS));
    HistoricItem historicItem = PersistenceExtensions.maximumSince(item,
            ZonedDateTime.of(2012, 1, 1, 0, 0, 0, 0, ZoneId.systemDefault()), TestPersistenceService.ID);
    assertNotNull(historicItem);
    assertEquals("1", historicItem.getState().toString());
    item.setState(new DecimalType(1));
    historicItem = PersistenceExtensions.maximumSince(item,
            ZonedDateTime.of(2012, 1, 1, 0, 0, 0, 0, ZoneId.systemDefault()), TestPersistenceService.ID);
    assertNotNull(historicItem);
    assertEquals("1", historicItem.getState().toString());
    historicItem = PersistenceExtensions.maximumSince(item,
            ZonedDateTime.of(2005, 1, 1, 0, 0, 0, 0, ZoneId.systemDefault()), TestPersistenceService.ID);
    assertNotNull(historicItem);
    assertEquals("2012", historicItem.getState().toString());
    assertEquals(ZonedDateTime.of(2012, 1, 1, 0, 0, 0, 0, ZoneId.systemDefault()), historicItem.getTimestamp());
    // default persistence service
    historicItem = PersistenceExtensions.maximumSince(item,
            ZonedDateTime.of(2005, 1, 1, 0, 0, 0, 0, ZoneId.systemDefault()));
    assertNotNull(historicItem);
    assertEquals("1", historicItem.getState().toString());
}