public Chart<P> build(TimeWindow timeWindow, List<P> sampledPoints) {
        Objects.requireNonNull(timeWindow, "timeWindow");

        if (CollectionUtils.isEmpty(sampledPoints)) {
            return new Chart<>(Collections.emptyList());
        }

        List<P> points = TimeWindows.createInitialPoints(timeWindow, this.function);
        final int windowRangeCount = timeWindow.getWindowRangeCount();
        for (P sampledPoint : sampledPoints) {
            int timeslotIndex = timeWindow.getWindowIndex(sampledPoint.getTimestamp());
            if (timeslotIndex < 0 || timeslotIndex >= windowRangeCount) {
                continue;
            }
            points.set(timeslotIndex, sampledPoint);
        }
        return new Chart<>(points);
    }
@author HyunGil Jeong
@author minwoo.jung
web/src/main/java/com/navercorp/pinpoint/web/vo/chart/TimeSeriesChartBuilder.java