code: public StreamQueryConfig withIdleStateRetentionTime(Time minTime, Time maxTime) {
  
  		if (maxTime.toMilliseconds() - minTime.toMilliseconds() < 300000 &&
  				!(maxTime.toMilliseconds() == 0 && minTime.toMilliseconds() == 0)) {
  			throw new IllegalArgumentException(
  					"Difference between minTime: " + minTime.toString() + " and maxTime: " + maxTime.toString() +
  					"shoud be at least 5 minutes.");
  		}
  		minIdleStateRetentionTime = minTime.toMilliseconds();
  		maxIdleStateRetentionTime = maxTime.toMilliseconds();
  		return this;
  	}
docs: Specifies a minimum and a maximum time interval for how long idle state, i.e., state which
  was not updated, will be retained.
  State will never be cleared until it was idle for less than the minimum time and will never
  be kept if it was idle for more than the maximum time.
  
  <p>When new data arrives for previously cleaned-up state, the new data will be handled as if it
  was the first data. This can result in previous results being overwritten.
  
  <p>Set to 0 (zero) to never clean-up the state.
  
  <p>NOTE: Cleaning up state requires additional bookkeeping which becomes less expensive for
  larger differences of minTime and maxTime. The difference between minTime and maxTime must be
  at least 5 minutes.
  
  @param minTime The minimum time interval for which idle state is retained. Set to 0 (zero) to
  never clean-up the state.
  @param maxTime The maximum time interval for which idle state is retained. Must be at least
  5 minutes greater than minTime. Set to 0 (zero) to never clean-up the state.