SiriLibrary { public static boolean isTimeRangeActiveOrUpcoming( HalfOpenTimestampRangeStructure range, Date time) { if (range.getStartTime() == null && range.getEndTime() == null) { return false; } return range.getEndTime() == null || !time.after(range.getEndTime()); }  @SuppressWarnings("unchecked") static List<T> getServiceRequestsForModule(
      ServiceRequest serviceRequest, ESiriModuleType moduleType); @SuppressWarnings("unchecked") static List<T> getSubscriptionRequestsForModule(
      SubscriptionRequest subscriptionRequest, ESiriModuleType moduleType); @SuppressWarnings("unchecked") static List<T> getServiceDeliveriesForModule(
      ServiceDelivery serviceDelivery, ESiriModuleType moduleType); static List<T> grep(Iterable<T> elements,
      String propertyPathExpression, Object equalityValue); static Siri copy(Siri payload); static AbstractServiceDeliveryStructure deepCopyModuleDelivery(
      ESiriModuleType moduleType, AbstractServiceDeliveryStructure from); static void copyServiceDelivery(AbstractServiceDeliveryStructure from,
      AbstractServiceDeliveryStructure to); static void copyList(List<T> from, List<T> to); static boolean isSituationClosed(PtSituationElementStructure situation); static boolean isSituationExpired(
      PtSituationElementStructure situation, Date currentTime); static boolean isSituationPublishedOrValid(
      PtSituationElementStructure situation, Date currentTime); static boolean isTimeRangeActive(
      HalfOpenTimestampRangeStructure range, Date time); static boolean isTimeRangeActiveOrUpcoming(
      HalfOpenTimestampRangeStructure range, Date time); static Map<String, String> getLineAsMap(String line); static boolean needsHelp(String[] args);  }
@Test public void testIsTimeRangeActiveOrUpcoming() { HalfOpenTimestampRangeStructure range = new HalfOpenTimestampRangeStructure(); assertFalse(SiriLibrary.isTimeRangeActiveOrUpcoming(range, time("08:00"))); range.setStartTime(time("09:00")); assertTrue(SiriLibrary.isTimeRangeActiveOrUpcoming(range, time("08:00"))); assertTrue(SiriLibrary.isTimeRangeActiveOrUpcoming(range, time("09:00"))); assertTrue(SiriLibrary.isTimeRangeActiveOrUpcoming(range, time("10:00"))); range.setStartTime(null); range.setEndTime(time("09:00")); assertTrue(SiriLibrary.isTimeRangeActiveOrUpcoming(range, time("08:00"))); assertTrue(SiriLibrary.isTimeRangeActiveOrUpcoming(range, time("09:00"))); assertFalse(SiriLibrary.isTimeRangeActiveOrUpcoming(range, time("10:00"))); range.setStartTime(time("09:00")); range.setEndTime(time("10:00")); assertTrue(SiriLibrary.isTimeRangeActiveOrUpcoming(range, time("08:00"))); assertTrue(SiriLibrary.isTimeRangeActiveOrUpcoming(range, time("09:00"))); assertTrue(SiriLibrary.isTimeRangeActiveOrUpcoming(range, time("09:30"))); assertTrue(SiriLibrary.isTimeRangeActiveOrUpcoming(range, time("10:00"))); assertFalse(SiriLibrary.isTimeRangeActiveOrUpcoming(range, time("11:00"))); }