code: @PublicEvolving
  	public AllWindowedStream<T, W> trigger(Trigger<? super T, ? super W> trigger) {
  		if (windowAssigner instanceof MergingWindowAssigner && !trigger.canMerge()) {
  			throw new UnsupportedOperationException("A merging window assigner cannot be used with a trigger that does not support merging.");
  		}
  
  		this.trigger = trigger;
  		return this;
  	}
docs: Sets the {@code Trigger} that should be used to trigger window emission.