docs: @Deprecated
  	@Internal
  	public <R, ACC> SingleOutputStreamOperator<R> fold(
  			ACC initialValue,
  			FoldFunction<T, ACC> foldFunction,
  			ProcessWindowFunction<ACC, R, K, W> windowFunction,
  			TypeInformation<ACC> foldResultType,
  			TypeInformation<R> windowResultType) {
  		if (foldFunction instanceof RichFunction) {
  			throw new UnsupportedOperationException("FoldFunction can not be a RichFunction.");
  		}
  		if (windowAssigner instanceof MergingWindowAssigner) {
  			throw new UnsupportedOperationException("Fold cannot be used with a merging WindowAssigner.");
  		}
  
  		//clean the closures
  		windowFunction = input.getExecutionEnvironment().clean(windowFunction);
  		foldFunction = input.getExecutionEnvironment().clean(foldFunction);
  
  		final String opName = generateOperatorName(windowAssigner, trigger, evictor, foldFunction, windowFunction);
  		KeySelector<T, K> keySel = input.getKeySelector();
  
  		OneInputStreamOperator<T, R> operator;
  
  		if (evictor != null) {
  			@SuppressWarnings({"unchecked", "rawtypes"})
  			TypeSerializer<StreamRecord<T>> streamRecordSerializer =
  					(TypeSerializer<StreamRecord<T>>) new StreamElementSerializer(input.getType().createSerializer(getExecutionEnvironment().getConfig()));
  
  			ListStateDescriptor<StreamRecord<T>> stateDesc =
  					new ListStateDescriptor<>("window-contents", streamRecordSerializer);
  
  			operator =
  					new EvictingWindowOperator<>(windowAssigner,
  							windowAssigner.getWindowSerializer(getExecutionEnvironment().getConfig()),
  							keySel,
  							input.getKeyType().createSerializer(getExecutionEnvironment().getConfig()),
  							stateDesc,
  							new InternalIterableProcessWindowFunction<>(new FoldApplyProcessWindowFunction<>(initialValue, foldFunction, windowFunction, foldResultType)),
  							trigger,
  							evictor,
  							allowedLateness,
  							lateDataOutputTag);
  
  		} else {
  			FoldingStateDescriptor<T, ACC> stateDesc = new FoldingStateDescriptor<>("window-contents",
  					initialValue,
  					foldFunction,
  					foldResultType.createSerializer(getExecutionEnvironment().getConfig()));
  
  			operator =
  					new WindowOperator<>(windowAssigner,
  							windowAssigner.getWindowSerializer(getExecutionEnvironment().getConfig()),
  							keySel,
  							input.getKeyType().createSerializer(getExecutionEnvironment().getConfig()),
  							stateDesc,
  							new InternalSingleValueProcessWindowFunction<>(windowFunction),
  							trigger,
  							allowedLateness,
  							lateDataOutputTag);
  		}
  
  		return input.transform(opName, windowResultType, operator);
  	}