code: @Override
  	public Map<Long, Double> mapping(Map<Long, Double> originalDatapoints, List<String> constants) {
  		SystemAssert.requireArgument(constants != null, "This transform needs constants");
          SystemAssert.requireArgument(constants.size() == 2, "This transform must provide exactly 2 constants.");    
          
          this.threshold = getOffsetInSeconds(constants.get(0)) * 1000;
          this.connectDistance = getOffsetInSeconds(constants.get(1)) * 1000;
                
          Map<Long, Double> resultMetric = new TreeMap<>();
          this.keyList = new ArrayList<Long>();
          this.resultKeyList = new ArrayList<Long>();
  		keyList.addAll(originalDatapoints.keySet());
  		Collections.sort(keyList);
  		
  		if (keyList.size() > 0){
  			connect(0, new ArrayList<>(Arrays.asList(keyList.get(0))));
  		}
  		
  		for(Long resultKey : resultKeyList){
  			resultMetric.put(resultKey, originalDatapoints.get(resultKey));
  		}
  		return resultMetric;
  	}
docs: mapping method implementation<br>
  This is the start point of this transform. It firstly verifies if all inputs are legal, then it crawls forward on this series and collects every qualified adjacent datapoints along the way.
  
  @param	originalDatapoints	Time series to be eveluate and transform. Cannot be null or empty.
  @param	constants	The constants requires two values. Details see above. Both time value and can be null but can not be empty.
  
  @return	resultMetric	A new time series that has been transformed.