T getResult() {
    return center.map(b -> Area.ofTriangle(left.getResult(), b, right.getCenter())).stream()
        .max(comparing(Area::getValue))
        .orElseThrow(() -> new RuntimeException("Can't obtain max area triangle"))
        .getGenerator();
  }
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