RBMBackedTimestampSetInRange extends KoryphePredicate<RBMBackedTimestampSet> { @Override public boolean test(final RBMBackedTimestampSet rbmBackedTimestampSet) { if (rbmBackedTimestampSet == null) { throw new IllegalArgumentException("TimestampSet cannot be null"); } if (rbmBackedTimestampSet.getNumberOfTimestamps() == 0) { throw new IllegalArgumentException("TimestampSet must contain at least one value"); } Long startEpoch = startTime != null ? startTime.longValue() : null; Long endEpoch = endTime != null ? endTime.longValue() : null; RBMBackedTimestampSet masked = new MaskTimestampSetByTimeRange(startEpoch, endEpoch, timeUnit).apply(rbmBackedTimestampSet); if (includeAllTimestamps) { return masked.equals(rbmBackedTimestampSet); } else { return masked.getNumberOfTimestamps() > 0L; } } RBMBackedTimestampSetInRange();  RBMBackedTimestampSetInRange(final Number startTime, final Number endTime);  RBMBackedTimestampSetInRange(final Number startTime, final Number endTime, final TimeUnit timeUnit);  RBMBackedTimestampSetInRange(final Number startTime, final Number endTime, final TimeUnit timeUnit, final Boolean includeAllTimestamps); @Override boolean test(final RBMBackedTimestampSet rbmBackedTimestampSet); Number getStartTime(); @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.WRAPPER_OBJECT) void setStartTime(final Number startTime); RBMBackedTimestampSetInRange startTime(final Number startTime); @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.WRAPPER_OBJECT) Number getEndTime(); void setEndTime(final Number endTime); RBMBackedTimestampSetInRange endTime(final Number endTime); TimeUnit getTimeUnit(); void setTimeUnit(final TimeUnit timeUnit); RBMBackedTimestampSetInRange timeUnit(final TimeUnit timeUnit); Boolean isIncludeAllTimestamps(); void setIncludeAllTimestamps(final Boolean includeAllTimestamps); void setIncludeAllTimestamps(); RBMBackedTimestampSetInRange includeAllTimestamps(); RBMBackedTimestampSetInRange includeAllTimestamps(final Boolean includeAllTimestamps);  }
@Test public void shouldReturnTrueIfNoUpperAndLowerBoundsAreProvided() { assertTrue(predicate.test(timestamps)); }