code: public static List<Double> toList(List<Pair> xyValues) {
          List<Double> result = new ArrayList<Double>(xyValues.size() * 2);
          for (Pair pair : xyValues) {
              result.add(pair.getX());
              result.add(pair.getY());
          }
          return result;
      }
docs: Creates a list of scalars from a list of Pair given in the form
  
  `\left(\{x_1,y_1\},...,\{x_n,y_n\}\right)`
  
  @param xyValues is the list of Pair
  @return a vector of scalars as `(x_1,y_1,...,x_n,y_n)`