Java CUSUM change detection in the trend