static <U extends Pair<Long, Double>> Triangle<U> of(List<Bucket<U>> buckets) {
    return new Triangle<>(buckets.get(0), buckets.get(1), buckets.get(2));
  }
this class is copied and modified from <a
href="https://github.com/ggalmazor/lt_downsampling_java8">...</a> project
library-udf/src/main/java/org/apache/iotdb/library/dprofile/util/Triangle.java