LastFilter extends Filter { @JsonIgnore public TimeWindow getWindow() { return WindowUtil.calculate(currentTime, duration); } LastFilter(); @Override void accept(FilterVisitor visitor); long getCurrentTime(); void setCurrentTime(long currentTime); Duration getDuration(); void setDuration(Duration duration); @Override boolean equals(Object rhs); @Override int hashCode(); @JsonIgnore TimeWindow getWindow(); @Override String toString(); @Override boolean isTemporal();  }
@Test public void testGetWindow() throws Exception { final String json = "{\n" + " \"operator\" : \"last\",\n" + " \"duration\" : \"1h\"\n" + "}"; LastFilter lastFilter = objectMapper.readValue(json, LastFilter.class); TimeWindow timeWindow = lastFilter.getWindow(); Assert.assertTrue((timeWindow.getEndTime() - timeWindow.getStartTime()) == 3600000); }