code: public static double computeCorrelation(final List<Double> list1, final List<Double> list2)
      {
          final double[] doubleArray1 = new double[list1.size()];
          final double[] doubleArray2 = new double[list2.size()];
  
          int off1 = 0;
          for (final double item : list1) {
              doubleArray1[off1] = item;
              off1++;
          }
  
          int off2 = 0;
          for (final double item : list2) {
              doubleArray2[off2] = item;
              off2++;
          }
  
          final double correlation = computeCorrelation(doubleArray1, doubleArray2);
  
          return correlation;
      }
docs: Computes the correlation between two datasets.
  @param list1 The first dataset as a list.
  @param list2 The second dataset as a list.
  @return The correlation between the two datasets.