static Pair<Long, Double> centerBetween(Pair<Long, Double> a, Pair<Long, Double> b) {
    Pair<Long, Double> vector = Pair.of(b.getLeft() - a.getLeft(), b.getRight() - a.getRight());
    Pair<Long, Double> halfVector = Pair.of(vector.getLeft() / 2, vector.getRight() / 2);
    return Pair.of(a.getLeft() + halfVector.getLeft(), a.getRight() + halfVector.getRight());
  }
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/Bucket.java