code: @SuppressWarnings("unchecked")
  	public SingleOutputStreamOperator<T> reduce(ReduceFunction<T> function) {
  		if (function instanceof RichFunction) {
  			throw new UnsupportedOperationException("ReduceFunction of reduce can not be a RichFunction. " +
  				"Please use reduce(ReduceFunction, WindowFunction) instead.");
  		}
  
  		//clean the closure
  		function = input.getExecutionEnvironment().clean(function);
  		return reduce(function, new PassThroughWindowFunction<K, W, T>());
  	}
docs: Applies a reduce function to the window. The window function is called for each evaluation
  of the window for each key individually. The output of the reduce function is interpreted
  as a regular non-windowed stream.
  
  <p>This window will try and incrementally aggregate data as much as the window policies
  permit. For example, tumbling time windows can aggregate the data, meaning that only one
  element per key is stored. Sliding time windows will aggregate on the granularity of the
  slide interval, so a few elements are stored per key (one per slide interval).
  Custom windows may not be able to incrementally aggregate, or may need to store extra values
  in an aggregation tree.
  
  @param function The reduce function.
  @return The data stream that is the result of applying the reduce function to the window.