test_class.file: server/src/test/java/io/spine/server/delivery/LiveDeliveryStationTest.java
test_class.identifier: LiveDeliveryStationTest
test_class.superclass: extends AbstractStationTest
test_case.body: @Test
      @DisplayName("modify the messages and keep them for longer if the deduplication window is set")
      void keepMessagesForLongerIfDeduplicationWindowSet() {
          InboxMessage toDeliver = toDeliver(targetOne, type);
          InboxMessage differentTarget = toDeliver(targetTwo, type);
          InboxMessage alreadyDelivered = delivered(targetOne, type);
          InboxMessage toCatchUp = catchingUp(targetOne, type);
  
          ImmutableList<InboxMessage> initialContents =
                  ImmutableList.of(toDeliver, differentTarget, alreadyDelivered, toCatchUp);
          Conveyor conveyor = new Conveyor(initialContents, new DeliveredMessages());
  
          Station station = new LiveDeliveryStation(MemoizingAction.empty(), fromSeconds(100));
          Station.Result result = station.process(conveyor);
  
          assertDeliveredCount(result, 2);
  
          Map<InboxMessageId, InboxMessage> contentsById =
                  stream(conveyor.iterator()).collect(toMap(InboxMessage::getId,msg -> msg));
          assertKeptForLonger(toDeliver.getId(), contentsById);
          assertKeptForLonger(differentTarget.getId(), contentsById);
          assertNotKeptForLonger(alreadyDelivered.getId(), contentsById);
          assertNotKeptForLonger(toCatchUp.getId(), contentsById);
      }
test_case.class_method_signature: LiveDeliveryStationTest.keepMessagesForLongerIfDeduplicationWindowSet()
test_case.full_signature: @Test @DisplayName("modify the messages and keep them for longer if the deduplication window is set") void keepMessagesForLongerIfDeduplicationWindowSet()
test_case.identifier: keepMessagesForLongerIfDeduplicationWindowSet
test_case.invocations: toDeliver toDeliver delivered catchingUp of empty fromSeconds process assertDeliveredCount collect stream iterator toMap assertKeptForLonger getId assertKeptForLonger getId assertNotKeptForLonger getId assertNotKeptForLonger getId
test_case.modifiers: @Test @DisplayName("modify the messages and keep them for longer if the deduplication window is set")
test_case.parameters: ()
test_case.return: void
test_case.signature: void keepMessagesForLongerIfDeduplicationWindowSet()
focal_class.declarator: action
focal_class.modifier: private final
focal_class.original_string: private final DeliveryAction action;
focal_class.type: DeliveryAction
focal_class.var_name: action
focal_class.declarator: deduplicationWindow
focal_class.modifier: private final @Nullable
focal_class.original_string: private final @Nullable Duration deduplicationWindow;
focal_class.type: Duration
focal_class.var_name: deduplicationWindow
focal_class.file: server/src/main/java/io/spine/server/delivery/LiveDeliveryStation.java
focal_class.identifier: LiveDeliveryStation
focal_class.class_method_signature: LiveDeliveryStation.LiveDeliveryStation(DeliveryAction action, Duration deduplicationWindow)
focal_class.full_signature:   LiveDeliveryStation(DeliveryAction action, Duration deduplicationWindow)
focal_class.identifier: LiveDeliveryStation
focal_class.parameters: (DeliveryAction action, Duration deduplicationWindow)
focal_class.signature:  LiveDeliveryStation(DeliveryAction action, Duration deduplicationWindow)
focal_class.class_method_signature: LiveDeliveryStation.process(Conveyor conveyor)
focal_class.full_signature: @Override public final Result process(Conveyor conveyor)
focal_class.identifier: process
focal_class.modifiers: @Override public final
focal_class.parameters: (Conveyor conveyor)
focal_class.return: Result
focal_class.signature: Result process(Conveyor conveyor)
focal_class.class_method_signature: LiveDeliveryStation.deduplicateAndSort(Collection<InboxMessage> messages,
                                                           Conveyor conveyor)
focal_class.full_signature: private static List<InboxMessage> deduplicateAndSort(Collection<InboxMessage> messages,
                                                           Conveyor conveyor)
focal_class.identifier: deduplicateAndSort
focal_class.modifiers: private static
focal_class.parameters: (Collection<InboxMessage> messages,
                                                           Conveyor conveyor)
focal_class.return: List<InboxMessage>
focal_class.signature: List<InboxMessage> deduplicateAndSort(Collection<InboxMessage> messages,
                                                           Conveyor conveyor)
focal_class.superclass: extends Station
focal_method.body: @Override
      public final Result process(Conveyor conveyor) {
          FilterToDeliver filter = new FilterToDeliver(conveyor);
          Collection<InboxMessage> filtered = filter.messagesToDispatch();
          if (filtered.isEmpty()) {
              return emptyResult();
          }
          List<InboxMessage> toDispatch = deduplicateAndSort(filtered, conveyor);
          DeliveryErrors errors = action.executeFor(toDispatch);
          conveyor.markDelivered(toDispatch);
          Result result = new Result(toDispatch.size(), errors);
          return result;
      }
focal_method.class_method_signature: LiveDeliveryStation.process(Conveyor conveyor)
focal_method.full_signature: @Override public final Result process(Conveyor conveyor)
focal_method.identifier: process
focal_method.invocations: messagesToDispatch isEmpty emptyResult deduplicateAndSort executeFor markDelivered size
focal_method.modifiers: @Override public final
focal_method.parameters: (Conveyor conveyor)
focal_method.return: Result
focal_method.signature: Result process(Conveyor conveyor)