private static boolean isLeftOutlier(int index,ArrayList<Double> values){
  double currentValue=values.get(index);
  double valueToLeft=values.get(index - 1);
  return Math.abs(currentValue - valueToLeft) > 20;
}

private static boolean isLeftOutlier ( int index , ArrayList < Double > values ) { double currentValue = values . get ( index ) ; double valueToLeft = values . get ( index - 1 ) ; return Math . abs ( currentValue - valueToLeft ) > 20 ; }
this is simply just a utility method for isoutlier
